'name' => basename($path),
'size' => (int)$propFindArray['{DAV:}getcontentlength'],
'identifier' => '/' . $path,
- 'storage' => $this->storageUid
+ 'storage' => $this->storageUid,
+ 'identifier_hash' => sha1('/' . $path),
+ 'folder_hash' => sha1('/' . $this->getFolderPathFromIdentifier($path)),
);
return $fileInfo;
}
/**
+ * @param string $path The identifier, without a leading slash!
+ * @return string The folder path, without a trailing slash. If the file is on root level, an empty string is returned
+ */
+ protected function getFolderPathFromIdentifier($path) {
+ $dirPath = dirname($path);
+
+ return $dirPath . ($dirPath !== '') ? '/' : '';
+ }
+
+ /**
* @param $path
* @return string
*/
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Resource\Driver\AbstractDriver;
+use TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver;
use TYPO3\CMS\Core\Resource\Exception\FileOperationErrorException;
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
use TYPO3\CMS\Core\Resource\ResourceStorage;
/**
* The driver class for WebDAV storages.
*/
-class WebDavDriver extends AbstractDriver {
+class WebDavDriver extends AbstractHierarchicalFilesystemDriver {
/**
* The base URL of the WebDAV share. Always ends with a trailing slash.
}
/**
- * Makes sure the path given as parameter is valid
- *
- * @param string $filePath The file path (most times filePath)
- * @return string
- */
- protected function canonicalizeAndCheckFilePath($filePath) {
- // TODO: Implement canonicalizeAndCheckFilePath() method.
- }
-
- /**
- * Makes sure the identifier given as parameter is valid
- *
- * @param string $fileIdentifier The file Identifier
- * @return string
- * @throws \TYPO3\CMS\Core\Resource\Exception\InvalidPathException
- */
- protected function canonicalizeAndCheckFileIdentifier($fileIdentifier) {
- // TODO: Implement canonicalizeAndCheckFileIdentifier() method.
- }
-
- /**
- * Makes sure the identifier given as parameter is valid
- *
- * @param string $folderIdentifier The folder identifier
- * @return string
- */
- protected function canonicalizeAndCheckFolderIdentifier($folderIdentifier) {
- // TODO: Implement canonicalizeAndCheckFolderIdentifier() method.
- }
-
- /**
* Merges the capabilites set by the administrator in the storage configuration with the actual capabilities of
* this driver and returns the result.
*