aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/common.php
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/storage/common.php
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/storage/common.php')
-rw-r--r--lib/private/files/storage/common.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 66ed713e22d..06c61fe6931 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -580,4 +580,29 @@ abstract class Common implements Storage {
}
return $result;
}
+
+ /**
+ * @inheritdoc
+ */
+ public function getMetaData($path) {
+ $permissions = $this->getPermissions($path);
+ if (!$permissions & \OCP\Constants::PERMISSION_READ) {
+ //cant read, nothing we can do
+ return null;
+ }
+
+ $data = [];
+ $data['mimetype'] = $this->getMimeType($path);
+ $data['mtime'] = $this->filemtime($path);
+ if ($data['mimetype'] == 'httpd/unix-directory') {
+ $data['size'] = -1; //unknown
+ } else {
+ $data['size'] = $this->filesize($path);
+ }
+ $data['etag'] = $this->getETag($path);
+ $data['storage_mtime'] = $data['mtime'];
+ $data['permissions'] = $this->getPermissions($path);
+
+ return $data;
+ }
}