Deletes the dummy file specified by the first parameter $fileName.

@param string $fileName
the path to the file to delete relative to
$this->uploadFolderPath, must not be empty

@return void

@throws \InvalidArgumentException
@throws Exception
513091
public function deleteDummyFile($fileName)
    {
        $absolutePathToFile = $this->getUploadFolderPath() . $fileName;
        $fileExists = file_exists($absolutePathToFile);

        if (!isset($this->dummyFiles[$fileName])) {
            throw new \InvalidArgumentException(
                'The file "' . $absolutePathToFile . '" which you are trying to delete ' .
                (!$fileExists ? 'does not exist and has never been ' : 'was not ') .
                'created by this instance of the testing framework.',
                1334439315
            );
        }

        if ($fileExists && !unlink($absolutePathToFile)) {
            throw new Exception('The file "' . $absolutePathToFile . '" could not be deleted.', 1334439327);
        }

        unset($this->dummyFiles[$fileName]);
    }
66084
public function write($fileName=null)
    {
        $this->_resetFileName($fileName);

        ksort($this->data);
        $output = array();

        foreach ($this->data as $path => $hash) {
            array_push($output, "$hash $path\n");
        }

        writeFileText(
            $this->fileName,
            $this->fileEncoding,
            implode('', $output)
        );
    }
874544
public function removeByQualifiedName($qualifiedName) {
		$this->ensureNotReadOnly('remove');
	
		$fileEngine = $this->getFileEngine();
		$fileEngine->removeByQualifiedName($qualifiedName);
		if (!$this->tm->hasOpenTransaction()) {
			$fileEngine->flush();
		}
	}
252643
public function handleEdit(string $fileName): void
	{
		if ($this->presenter->isAjax() && $this->editable) {
			$file = $this->getFileInfo($fileName);
			if ($file->editable) {
				$this->viewFile($file);
				$form = $this['editForm'];
				$form->setDefaults([
					'id' => $file->name,
					'content' => $file->content
				]);
				$this->template->editFile = true;
			}
			$this->redrawControl('fileManagerContainer');
		} else {
			exit;
		}
	}
1040423
private function warmUpCacheFromFile($filename)
    {
        if (preg_match('#\.php$#', $filename) == false) {
            throw new \InvalidArgumentException('The cache filename must ends with the extension ".php".');
        }

        if (file_exists($filename) == false) {
            $this->hasPendingChasges = true;

            return;
        }

        $fileContent = include_once($filename);

        if (is_array($fileContent) == false) {
            throw new \InvalidArgumentException('Cache file invalid format.');
        }

        foreach ($fileContent as $filename => $hash) {
            $this->write($filename, $hash);
        }

        $this->isInitialized = true;
    }
169298
public function handleDelete(string $fileName): void
	{
		if ($this->presenter->isAjax() && $this->editable) {
			$file = $this->getFileInfo($fileName);
			if ($file->isDir) {
				File::removeDir($this->getFullPath($file->name));
			} else {
				unlink($this->getFullPath($file->name));
			}
			$this->redrawControl('fileManagerContainer');
		} else {
			exit;
		}
	}
969891
public function setFilename($filename)
    {
        $this->throwExceptionIfProtected();

        $pathInfo = UnicodeFunctions::pathinfo($filename);
        $extension = (isset($pathInfo['extension']) ? '.' . strtolower($pathInfo['extension']) : '');
        $this->filename = $pathInfo['filename'] . $extension;
        $this->mediaType = Utility\MediaTypes::getMediaTypeFromFilename($this->filename);
    }
656101
public function setFilename($filename)
    {
        if (is_array($filename) && isset($filename['name'])) {
            $this->filename = $filename['name'];
        } else {
            $this->filename = $filename;
        }
    }
1217864
private function delete($filename, $isDir = false)
    {
        if ($this->isSFTP()) {
            $deleted = @$this->ftp->delete($filename, $isDir);
        } else {
            $deleted = @$this->ftpDelete($filename);
        }
        if (!$deleted) {
            $this->fail("couldn't delete {$filename}");
        }
        $this->debug("Deleted: {$filename}");
    }
332690
public function delete(string $filename): DeleteCommand
    {
        /** @var DeleteCommand $command */
        $command = $this->builder->build(DeleteCommand::class);
        $command->byFilename($filename);

        return $command;
    }
1135914
protected function setFilenameOption($filename): void
    {
        if (is_string($filename)) {
            $filename = new BasicFilename($filename);
        }

        if (!is_callable($filename)) {
            throw new TypeError("Filename should be a string or callable");
        }

        $this->filename = $filename;
    }
1050048
public function remove($fileName)
    {
        $fileName = $this->getTargetDir() . DIRECTORY_SEPARATOR . $fileName;

        if (!file_exists($fileName)) {
            return;
        }

        unlink($fileName);
    }
291504
public function setFileName($filename)
    {
        $this->load();
        $this->filename = $filename;
        $this->io = new Real($filename);
    }
823695
public function removeFile( $fileName )
	{
		$this->connection->checkConnection();
		return @ftp_delete( $this->connection->getResource(), $fileName );
	}
1220378
protected function validateFileName($fileName = null)
    {
        if ($fileName === null) {
            $fileName = $this->fileName;
        }

        $fileName = trim($fileName);

        if (!strlen($fileName)) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.file_name_required', [
                    'allowed' => implode(', ', $this->allowedExtensions),
                    'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                ])
            ]);
        }

        if (!FileHelper::validateExtension($fileName, $this->allowedExtensions, false)) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.invalid_file_extension', [
                    'allowed' => implode(', ', $this->allowedExtensions),
                    'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                ])
            ]);
        }

        if (!FileHelper::validatePath($fileName, null)) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.invalid_file', [
                    'name' => $fileName
                ])
            ]);
        }
    }
1372470
static public function createFromFile($filename) {
		if (!file_exists($filename))
			throw new Exception('Invalid (filename) parameter! File does not exist!');

		$image_info = getimagesize($filename);
		if ($image_info === false)
			throw new Exception('Invalid (filename) parameter! File is corrupted!');

		switch ($image_info[2]) {
			case IMAGETYPE_JPEG:
			case IMAGETYPE_JPEG2000:
				$image = imagecreatefromjpeg($filename);
				break;
			case IMAGETYPE_PNG:
				$image = imagecreatefrompng($filename);
				break;
			case IMAGETYPE_GIF:
				$image = imagecreatefromgif($filename);
				break;
			case IMAGETYPE_WBMP:
				$image = imagecreatefromwbmp($filename);
				break;
			case IMAGETYPE_BMP:
				$image = imagecreatefrombmp($filename);
				break;
			default:
				throw new Exception('Unknown image format!');
				break;
		}

		return new self($image);
	}
97567
public function removeFileParameter($name)
    {
        if (!$this->hasFileParameter($name)) {
            throw new \InvalidArgumentException(sprintf('The file request parameter "%s" does not exist.', $name));
        }

        unset($this->fileParameters[$name]);
    }