/** * Returns TRUE if the specified file exists. * * @param string $identifier * @return boolean */ public function hasFile($identifier) { // @todo: access check? return $this->driver->fileExists($identifier); }
/** * Entry method for use as file list filter. * * We have to use -1 as the „don't include“ return value, as call_user_func() will return FALSE * if calling the method failed and thus we can't use that as a return value. * * @param string $itemName * @param string $itemIdentifier * @param string $parentIdentifier * @param array $additionalInformation Additional information about the inspected item * @param \TYPO3\CMS\Core\Resource\Driver\AbstractDriver $driver * @return boolean|integer -1 if the file should not be included in a listing */ public function filterFileList($itemName, $itemIdentifier, $parentIdentifier, array $additionalInformation, \TYPO3\CMS\Core\Resource\Driver\AbstractDriver $driver) { $returnCode = TRUE; // Early return in case no file filters are set at all if ($this->allowedFileExtensions === NULL && $this->disallowedFileExtensions === NULL) { return $returnCode; } // Check that this is a file and not a folder if ($driver->fileExists($itemIdentifier)) { $file = $driver->getFile($itemIdentifier); if (!$this->isAllowed($file)) { $returnCode = -1; } } return $returnCode; }