also add getLocalFolder to OC_Filsystem and OC_FilesystemView

This commit is contained in:
Robin Appelman 2012-08-19 02:42:15 +02:00
parent 9b44d0cb32
commit 154ce0f68d
2 changed files with 17 additions and 0 deletions

View File

@ -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

View File

@ -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