if (!$info) throw new Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located');
if ($info['mimetype'] == 'httpd/unix-directory') {
-
- return new OC_Connector_Sabre_Directory($path, $info);
-
+ $node = new OC_Connector_Sabre_Directory($path);
} else {
-
- return new OC_Connector_Sabre_File($path, $info);
-
+ $node = new OC_Connector_Sabre_File($path);
}
+ $node->setFileinfoCache($info);
+ return $node;
}
/**
* @param string $path
* @return void
*/
- public function __construct($path, $fileinfo_cache = null) {
+ public function __construct($path) {
$this->path = $path;
- if ($fileinfo_cache) {
- $this->fileinfo_cache = $fileinfo_cache;
- }
}
}
+ public function setFileinfoCache($fileinfo_cache)
+ {
+ $this->fileinfo_cache = $fileinfo_cache;
+ }
+
/**
- * Set the stat cache
+ * Make sure the fileinfo cache is filled. Uses OC_FileCache or a direct stat
*/
protected function getFileinfoCache() {
if (!isset($this->fileinfo_cache)) {