summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-08-19 02:42:15 +0200
committerRobin Appelman <icewind@owncloud.com>2012-08-19 02:42:15 +0200
commit154ce0f68ddd7b1d2a173515cf3c3ceab3611a48 (patch)
tree32d0ee226bc542493f1809631d175332f97044de
parent9b44d0cb32795c5ec645922b204de88c8f33c196 (diff)
downloadnextcloud-server-154ce0f68ddd7b1d2a173515cf3c3ceab3611a48.tar.gz
nextcloud-server-154ce0f68ddd7b1d2a173515cf3c3ceab3611a48.zip
also add getLocalFolder to OC_Filsystem and OC_FilesystemView
-rw-r--r--lib/filesystem.php7
-rw-r--r--lib/filesystemview.php10
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