예제 #1
0
 /**
  * Construct a Home storage instance
  * @param array $arguments array with "user" containing the
  * storage owner and "legacy" containing "true" if the storage is
  * a legacy storage with "local::" URL instead of the new "home::" one.
  */
 public function __construct($arguments)
 {
     $this->user = $arguments['user'];
     $datadir = $this->user->getHome();
     if (isset($arguments['legacy']) && $arguments['legacy']) {
         // legacy home id (<= 5.0.12)
         $this->id = 'local::' . $datadir . '/';
     } else {
         $this->id = 'home::' . $this->user->getUID();
     }
     parent::__construct(array('datadir' => $datadir));
 }
예제 #2
0
 /**
  * @param $handle
  * @return mixed
  */
 public function readdir($handle)
 {
     $fsLocal = new Storage\Local(array('datadir' => '/'));
     return $fsLocal->readdir($handle);
 }
예제 #3
0
 public function touch($path, $mtime = null)
 {
     return $this->storage->touch($path, $mtime);
 }
예제 #4
0
 /**
  * @param \OCP\Files\Storage $sourceStorage
  * @param string $sourceInternalPath
  * @param string $targetInternalPath
  * @return bool
  */
 public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath)
 {
     if ($sourceStorage->instanceOfStorage('\\OC\\Files\\Storage\\Local')) {
         /**
          * @var \OC\Files\Storage\Local $sourceStorage
          */
         $rootStorage = new Local(['datadir' => '/']);
         return $rootStorage->rename($sourceStorage->getSourcePath($sourceInternalPath), $this->getSourcePath($targetInternalPath));
     } else {
         return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
     }
 }