public function updateContents($contents, $rescanThumbnails = true)
    {
        $this->releaseImagineImage();
        $storage = $this->getFile()->getFileStorageLocationObject();
        if ($storage !== null) {
            $app = Application::getFacadeApplication();
            $cf = $app->make('helper/concrete/file');
            $path = $cf->prefix($this->fvPrefix, $this->fvFilename);
            $filesystem = $storage->getFileSystemObject();
            try {
                if ($filesystem->has($path)) {
                    $filesystem->delete($path);
                }
            } catch (FileNotFoundException $x) {
            }
            $filesystem->write($path, $contents);
            $this->logVersionUpdate(self::UT_CONTENTS);
            $fve = new FileVersionEvent($this);
            $app->make(EventDispatcherInterface::class)->dispatch('on_file_version_update_contents', $fve);
            $this->refreshAttributes($rescanThumbnails);
        }
    }