private function removeFileInFileSystem(File $file)
	{
		$filePath = $this->getFilesystemPath($file);

		if (file_exists($filePath)) {
			$result = unlink($filePath);

			if ( ! $result) {
				throw new Exception\RuntimeException("Could not delete '$filePath' from file storage");
			}
		}

		// remove sizes if object is image
		if ($file instanceof Image) {
			$sizes = $file->getImageSizeCollection();
			foreach ($sizes as $size) {
				$sizePath = $this->getImagePath($file, $size->getName());

				if (file_exists($sizePath)) {
					$result = unlink($sizePath);

					if ( ! $result) {
						throw new Exception\RuntimeException("Could not delete '$sizePath' from file storage");
					}
				}
			}
		}
	}
private function removeFileInFileSystem(File $file)
	{
		$filePath = $this->getFilesystemPath($file);

		if (file_exists($filePath)) {
			$result = unlink($filePath);

			if ( ! $result) {
				throw new Exception\RuntimeException("Could not delete '$filePath' from file storage");
			}
		}

		// remove sizes if object is image
		if ($file instanceof Image) {
			$sizes = $file->getImageSizeCollection();
			foreach ($sizes as $size) {
				$sizePath = $this->getImagePath($file, $size->getName());

				if (file_exists($sizePath)) {
					$result = unlink($sizePath);

					if ( ! $result) {
						throw new Exception\RuntimeException("Could not delete '$sizePath' from file storage");
					}
				}
			}
		}
	}
private function removeFileInFileSystem ( File $ file ) { $ filePath = $ this -> getFilesystemPath ( $ file ) ; if ( file_exists ( $ filePath ) ) { $ result = unlink ( $ filePath ) ; if ( ! $ result ) { throw new Exception \ RuntimeException ( "Could not delete '$filePath' from file storage" ) ; } } // remove sizes if object is image if ( $ file instanceof Image ) { $ sizes = $ file -> getImageSizeCollection ( ) ; foreach ( $ sizes as $ size ) { $ sizePath = $ this -> getImagePath ( $ file , $ size -> getName ( ) ) ; if ( file_exists ( $ sizePath ) ) { $ result = unlink ( $ sizePath ) ; if ( ! $ result ) { throw new Exception \ RuntimeException ( "Could not delete '$sizePath' from file storage" ) ; } } } } }
Remove file in file system
@param File $file
Remove file in file system