aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-04-20 18:36:23 +0200
committerVincent Petry <pvince81@owncloud.com>2015-04-20 18:36:23 +0200
commita13088818a73ecdf6f7d6600c011e0fa49054b51 (patch)
tree1302033aec7a663cf9d8a12e61f17db56701641a /lib/private/files/cache
parentfe2cbc37951ea25e3d545d78289c64542ef58eca (diff)
parent32995ace1c1ea453e08b1afd6f6d43cf68f2e3b1 (diff)
downloadnextcloud-server-a13088818a73ecdf6f7d6600c011e0fa49054b51.tar.gz
nextcloud-server-a13088818a73ecdf6f7d6600c011e0fa49054b51.zip
Merge pull request #15748 from owncloud/fixing-enc-filesize-once-more
Introduce Storage::getData() to allow storage implementations more contr...
Diffstat (limited to 'lib/private/files/cache')
-rw-r--r--lib/private/files/cache/scanner.php17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 0878b6c60a0..d253afbfa1d 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -103,23 +103,10 @@ class Scanner extends BasicEmitter {
* @return array an array of metadata of the file
*/
public function getData($path) {
- $permissions = $this->storage->getPermissions($path);
- if (!$permissions & \OCP\PERMISSION_READ) {
- //cant read, nothing we can do
+ $data = $this->storage->getMetaData($path);
+ if (is_null($data)) {
\OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG);
- return null;
}
- $data = array();
- $data['mimetype'] = $this->storage->getMimeType($path);
- $data['mtime'] = $this->storage->filemtime($path);
- if ($data['mimetype'] == 'httpd/unix-directory') {
- $data['size'] = -1; //unknown
- } else {
- $data['size'] = $this->storage->filesize($path);
- }
- $data['etag'] = $this->storage->getETag($path);
- $data['storage_mtime'] = $data['mtime'];
- $data['permissions'] = $permissions;
return $data;
}