/** * @param \OC\Files\Storage\Shared $storage * @param IStorage $sourceStorage * @param ICacheEntry $sourceRootInfo */ public function __construct($storage, IStorage $sourceStorage, ICacheEntry $sourceRootInfo) { $this->storage = $storage; $this->sourceStorage = $sourceStorage; $this->sourceRootInfo = $sourceRootInfo; $this->sourceCache = $sourceStorage->getCache(); parent::__construct($this->sourceCache, $this->sourceRootInfo->getPath()); }
private function isValid() { $this->init(); return $this->sourceRootInfo && ($this->sourceRootInfo->getPermissions() & Constants::PERMISSION_SHARE) === Constants::PERMISSION_SHARE; }
private function cacheEntryToArray(ICacheEntry $entry) { return ['size' => $entry->getSize(), 'mtime' => $entry->getMTime(), 'storage_mtime' => $entry->getStorageMTime(), 'mimetype' => $entry->getMimeType(), 'mimepart' => $entry->getMimePart(), 'etag' => $entry->getEtag(), 'permissions' => $entry->getPermissions(), 'encrypted' => $entry->isEncrypted()]; }