diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filesystem.php | 7 | ||||
-rw-r--r-- | lib/filesystemview.php | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php index ffb8643d491..6f11cda4fd6 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -336,6 +336,13 @@ class OC_Filesystem{ static public function getLocalFile($path){ return self::$defaultInstance->getLocalFile($path); } + /** + * @param string path + * @return string + */ + static public function getLocalFolder($path){ + return self::$defaultInstance->getLocalFolder($path); + } /** * return path to file which reflects one visible in browser diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 571c75f8f31..6e76e1b6da5 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -147,6 +147,16 @@ class OC_FilesystemView { return $storage->getLocalFile($this->getInternalPath($path)); } } + /** + * @param string path + * @return string + */ + public function getLocalFolder($path) { + $parent=substr($path, 0, strrpos($path,'/')); + if(OC_Filesystem::isValidPath($parent) and $storage=$this->getStorage($path)) { + return $storage->getLocalFolder($this->getInternalPath($path)); + } + } /** * the following functions operate with arguments and return values identical |