|
|
|
@ -36,9 +36,12 @@ |
|
|
|
namespace OCA\DAV\Connector\Sabre; |
|
|
|
|
|
|
|
use OC\Files\Mount\MoveableMount; |
|
|
|
use OC\Files\Node\File; |
|
|
|
use OC\Files\Node\Folder; |
|
|
|
use OC\Files\View; |
|
|
|
use OCA\DAV\Connector\Sabre\Exception\InvalidPath; |
|
|
|
use OCP\Files\FileInfo; |
|
|
|
use OCP\Files\IRootFolder; |
|
|
|
use OCP\Files\StorageNotAvailableException; |
|
|
|
use OCP\Share\IShare; |
|
|
|
use OCP\Share\Exceptions\ShareNotFound; |
|
|
|
@ -75,6 +78,8 @@ abstract class Node implements \Sabre\DAV\INode { |
|
|
|
*/ |
|
|
|
protected $shareManager; |
|
|
|
|
|
|
|
protected \OC\Files\Node\Node $node; |
|
|
|
|
|
|
|
/** |
|
|
|
* Sets up the node, expects a full path name |
|
|
|
* |
|
|
|
@ -91,10 +96,22 @@ abstract class Node implements \Sabre\DAV\INode { |
|
|
|
} else { |
|
|
|
$this->shareManager = \OC::$server->getShareManager(); |
|
|
|
} |
|
|
|
$root = \OC::$server->get(IRootFolder::class); |
|
|
|
if ($info->getType()=== FileInfo::TYPE_FOLDER) { |
|
|
|
$this->node = new Folder($root, $view, $this->path, $info); |
|
|
|
} else { |
|
|
|
$this->node = new File($root, $view, $this->path, $info); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected function refreshInfo() { |
|
|
|
$this->info = $this->fileView->getFileInfo($this->path); |
|
|
|
$root = \OC::$server->get(IRootFolder::class); |
|
|
|
if ($this->info->getType() === FileInfo::TYPE_FOLDER) { |
|
|
|
$this->node = new Folder($root, $this->fileView, $this->path, $this->info); |
|
|
|
} else { |
|
|
|
$this->node = new File($root, $this->fileView, $this->path, $this->info); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -403,6 +420,10 @@ abstract class Node implements \Sabre\DAV\INode { |
|
|
|
return $this->info; |
|
|
|
} |
|
|
|
|
|
|
|
public function getNode(): \OCP\Files\Node { |
|
|
|
return $this->node; |
|
|
|
} |
|
|
|
|
|
|
|
protected function sanitizeMtime($mtimeFromRequest) { |
|
|
|
return MtimeSanitizer::sanitizeMtime($mtimeFromRequest); |
|
|
|
} |
|
|
|
|