/** * Move the mount point to $target * * @param string $target the target mount point * @return bool */ public function moveMount($target) { $relTargetPath = $this->stripUserFilesPath($target); $share = $this->storage->getShare(); $result = true; try { $this->updateFileTarget($relTargetPath, $share); $this->setMountPoint($target); $this->storage->setMountPoint($relTargetPath); } catch (\Exception $e) { \OCP\Util::writeLog('file sharing', 'Could not rename mount point for shared folder "' . $this->getMountPoint() . '" to "' . $target . '"', \OCP\Util::ERROR); } return $result; }
/** * Move the mount point to $target * * @param string $target the target mount point * @return bool */ public function moveMount($target) { $relTargetPath = $this->stripUserFilesPath($target); $share = $this->storage->getShare(); $result = true; if (!empty($share['grouped'])) { foreach ($share['grouped'] as $s) { $result = $this->updateFileTarget($relTargetPath, $s) && $result; } } else { $result = $this->updateFileTarget($relTargetPath, $share) && $result; } if ($result) { $this->setMountPoint($target); $this->storage->setUniqueName(); $this->storage->setMountPoint($relTargetPath); } else { \OCP\Util::writeLog('file sharing', 'Could not rename mount point for shared folder "' . $this->getMountPoint() . '" to "' . $target . '"', \OCP\Util::ERROR); } return $result; }