Ejemplo n.º 1
0
 /**
  * Checks if a resource (file or folder) is within the given folder
  *
  * @param Folder $folder
  * @param ResourceInterface $resource
  * @return bool
  * @throws \InvalidArgumentException
  */
 public function isWithinFolder(Folder $folder, ResourceInterface $resource)
 {
     if ($folder->getStorage() !== $this) {
         throw new \InvalidArgumentException('Given folder "' . $folder->getIdentifier() . '" is not part of this storage!', 1422709241);
     }
     if ($folder->getStorage() !== $resource->getStorage()) {
         return false;
     }
     return $this->driver->isWithin($folder->getIdentifier(), $resource->getIdentifier());
 }
Ejemplo n.º 2
0
 /**
  * @param string $identifier
  * @return bool
  */
 public function isWithinProcessingFolder($identifier)
 {
     return $this->driver->isWithin($this->getProcessingFolder()->getIdentifier(), $identifier);
 }