public function save(File $file, $preparedPath)
    {
        if (false === ($i = array_search($preparedPath, $this->preparedPaths))) {
            throw new \RuntimeException("{$preparedPath} is not prepared by the filemanager");
        }
        unset($this->preparedPaths[$i]);
        $existed = $this->fs->exists($preparedPath);
        @$this->fs->remove($preparedPath);

        try {
            $this->dispatchEvent($existed ? ResourceEvent::REPLACED : ResourceEvent::CREATED, $preparedPath);
            $file->move(dirname($preparedPath), basename($preparedPath));
        } catch (FileException $fileException) {
            throw new FileException(
                $fileException->getMessage() . "\n(hint: check the 'upload_max_filesize' in php.ini)",
                0,
                $fileException
            );
        }
    }