/** * {@inheritDoc} */ public function delete(Filesystem $remote, array $options = array()) { if (!$remote instanceof File) { throw new \InvalidArgumentException(sprintf("Invalid filesystem given, expected instance of File got %s", get_class($remote))); } if (null === $this->manager->findFileByFile($remote)) { throw new DirectoryException(sprintf("Could not locate file %s", $remote->getRealpath())); } $this->wrapper->delete($remote->getRealpath()); return true; }
/** * {@inheritDoc} */ public function fileExists(File $file) { try { return null !== $this->manager->findFileByFile($file); } catch (DirectoryException $e) { return false; } }