2 namespace TYPO3\CMS\Core\Resource;
107 if ($rootId === null) {
108 $rootId = $this->storage->getRootLevelFolder()->getIdentifier();
111 if ($this->identifier !== $rootId) {
114 }
catch (
Exception\InsufficientFolderAccessPermissionsException $e) {
119 return $readablePath . ($this->name ? $this->name .
'/' :
'');
163 return $this->storage->hashFileIdentifier($this->identifier);
188 return $this->
getStorage()->getPublicUrl($this, $relativeToCurrentScript);
209 public function getFiles($start = 0, $numberOfItems = 0, $filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive =
false, $sort =
'', $sortRev =
false)
212 if ($filterMode ===
false) {
214 $backedUpFilters = array();
219 $fileObjects = $this->storage->getFilesInFolder($this, $start, $numberOfItems, $useFilters, $recursive, $sort, $sortRev);
235 public function getFileCount(array $filterMethods = array(), $recursive =
false)
237 return $this->storage->countFilesInFolder($this,
true, $recursive);
249 if (!$this->storage->hasFolderInFolder(
$name, $this)) {
250 throw new \InvalidArgumentException(
'Folder "' .
$name .
'" does not exist in "' . $this->identifier .
'"', 1329836110);
252 return $this->storage->getFolderInFolder(
$name, $this);
264 public function getSubfolders($start = 0, $numberOfItems = 0, $filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive =
false)
267 $folderObjects = $this->storage->getFoldersInFolder($this, $start, $numberOfItems, $useFilters, $recursive);
269 return $folderObjects;
284 return $this->storage->addFile($localFilePath, $this, $fileName, $conflictMode);
296 return $this->storage->addUploadedFile($uploadedFileData, $this, $uploadedFileData[
'name'], $conflictMode);
307 return $this->storage->renameFolder($this, $newName);
316 public function delete($deleteRecursively =
true)
318 return $this->storage->deleteFolder($this, $deleteRecursively);
329 return $this->storage->createFile($fileName, $this);
340 return $this->storage->createFolder($folderName, $this);
353 return $targetFolder->
getStorage()->copyFolder($this, $targetFolder, $targetFolderName, $conflictMode);
366 return $targetFolder->
getStorage()->moveFolder($this, $targetFolder, $targetFolderName, $conflictMode);
377 return $this->storage->hasFileInFolder(
$name, $this);
388 return $this->storage->hasFolderInFolder(
$name, $this);
400 return $this->
getStorage()->checkFolderActionPermission($action, $this);
401 }
catch (
Exception\ResourcePermissionsUnavailableException $e) {
418 if (isset($properties[
'identifier'])) {
419 $this->identifier = $properties[
'identifier'];
421 if (isset($properties[
'name'])) {
422 $this->name = $properties[
'name'];
434 $backedUpFilters = null;
437 switch ($filterMode) {
438 case self::FILTER_MODE_USE_OWN_FILTERS:
439 $backedUpFilters = $this->storage->getFileAndFolderNameFilters();
440 $this->storage->setFileAndFolderNameFilters($this->fileAndFolderNameFilters);
444 case self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS:
445 if (!empty($this->fileAndFolderNameFilters)) {
446 $backedUpFilters = $this->storage->getFileAndFolderNameFilters();
447 foreach ($this->fileAndFolderNameFilters as $filter) {
448 $this->storage->addFileAndFolderNameFilter($filter);
454 case self::FILTER_MODE_USE_STORAGE_FILTERS:
459 case self::FILTER_MODE_NO_FILTERS:
464 return array($backedUpFilters, $useFilters);
476 if ($backedUpFilters !== null) {
477 $this->storage->setFileAndFolderNameFilters($backedUpFilters);
489 $this->fileAndFolderNameFilters = $filters;
499 return $this->storage->getRole($this);