\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 = $this->storage->getData($path);
$data['permissions'] = $permissions;
+
return $data;
}
}
return $result;
}
+
+ /**
+ * @inheritdoc
+ */
+ public function getData($path) {
+ $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'];
+ return $data;
+ }
}
*/
public function getStorageCache();
+ /**
+ * @param $path
+ * @return array
+ */
+ public function getData($path);
+
}
return $this->storage->filesize($path);
}
+ /**
+ * @param $path
+ * @return array
+ */
+ public function getData($path) {
+ $data = $this->storage->getData($path);
+ $fullPath = $this->getFullPath($path);
+
+ if (isset($this->unencryptedSize[$fullPath])) {
+ $size = $this->unencryptedSize[$fullPath];
+
+ $data['encrypted'] = true;
+ $data['size'] = $size;
+ } else {
+ $info = $this->getCache()->get($path);
+ if (isset($info['fileid']) && $info['encrypted']) {
+ $data['encrypted'] = true;
+ $data['size'] = $info['size'];
+ }
+ }
+
+ return $data;
+ }
/**
* see http://php.net/manual/en/function.file_get_contents.php
*
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
}
+
+ /**
+ * @param $path
+ * @return array
+ */
+ public function getData($path) {
+ return $this->storage->getData($path);
+ }
}