|
|
|
@ -110,6 +110,7 @@ class View { |
|
|
|
*/ |
|
|
|
public function getLocalFile($path) { |
|
|
|
$parent = substr($path, 0, strrpos($path, '/')); |
|
|
|
$path = $this->getAbsolutePath($path); |
|
|
|
list($storage, $internalPath) = Filesystem::resolvePath($path); |
|
|
|
if (Filesystem::isValidPath($parent) and $storage) { |
|
|
|
return $storage->getLocalFile($internalPath); |
|
|
|
@ -124,6 +125,7 @@ class View { |
|
|
|
*/ |
|
|
|
public function getLocalFolder($path) { |
|
|
|
$parent = substr($path, 0, strrpos($path, '/')); |
|
|
|
$path = $this->getAbsolutePath($path); |
|
|
|
list($storage, $internalPath) = Filesystem::resolvePath($path); |
|
|
|
if (Filesystem::isValidPath($parent) and $storage) { |
|
|
|
return $storage->getLocalFolder($internalPath); |
|
|
|
@ -334,8 +336,8 @@ class View { |
|
|
|
$mp1 = $this->getMountPoint($path1 . $postFix1); |
|
|
|
$mp2 = $this->getMountPoint($path2 . $postFix2); |
|
|
|
if ($mp1 == $mp2) { |
|
|
|
list($storage, $internalPath1) = Filesystem::resolvePath($path1 . $postFix1); |
|
|
|
list(, $internalPath2) = Filesystem::resolvePath($path2 . $postFix2); |
|
|
|
list($storage, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); |
|
|
|
list(, $internalPath2) = Filesystem::resolvePath($absolutePath2 . $postFix2); |
|
|
|
if ($storage) { |
|
|
|
$result = $storage->rename($internalPath1, $internalPath2); |
|
|
|
} else { |
|
|
|
@ -345,7 +347,7 @@ class View { |
|
|
|
$source = $this->fopen($path1 . $postFix1, 'r'); |
|
|
|
$target = $this->fopen($path2 . $postFix2, 'w'); |
|
|
|
$count = \OC_Helper::streamCopy($source, $target); |
|
|
|
list($storage1, $internalPath1) = Filesystem::resolvePath($path1 . $postFix1); |
|
|
|
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); |
|
|
|
$storage1->unlink($internalPath1); |
|
|
|
$result = $count > 0; |
|
|
|
} |
|
|
|
@ -417,8 +419,8 @@ class View { |
|
|
|
$mp1 = $this->getMountPoint($path1 . $postFix1); |
|
|
|
$mp2 = $this->getMountPoint($path2 . $postFix2); |
|
|
|
if ($mp1 == $mp2) { |
|
|
|
list($storage, $internalPath1) = Filesystem::resolvePath($path1 . $postFix1); |
|
|
|
list(, $internalPath2) = Filesystem::resolvePath($path2 . $postFix2); |
|
|
|
list($storage, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); |
|
|
|
list(, $internalPath2) = Filesystem::resolvePath($absolutePath2 . $postFix2); |
|
|
|
if ($storage) { |
|
|
|
$result = $storage->copy($internalPath1, $internalPath2); |
|
|
|
} else { |
|
|
|
@ -552,7 +554,7 @@ class View { |
|
|
|
array(Filesystem::signal_param_path => $path) |
|
|
|
); |
|
|
|
} |
|
|
|
list($storage, $internalPath) = Filesystem::resolvePath($path . $postFix); |
|
|
|
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); |
|
|
|
if ($storage) { |
|
|
|
$result = $storage->hash($type, $internalPath, $raw); |
|
|
|
$result = \OC_FileProxy::runPostProxies('hash', $absolutePath, $result); |
|
|
|
@ -587,7 +589,7 @@ class View { |
|
|
|
return false; |
|
|
|
} |
|
|
|
$run = $this->runHooks($hooks, $path); |
|
|
|
list($storage, $internalPath) = Filesystem::resolvePath($path . $postFix); |
|
|
|
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); |
|
|
|
if ($run and $storage) { |
|
|
|
if (!is_null($extraParam)) { |
|
|
|
$result = $storage->$operation($internalPath, $extraParam); |
|
|
|
@ -747,8 +749,23 @@ class View { |
|
|
|
$files[$i]['permissions'] = $permissions[$file['fileid']]; |
|
|
|
} |
|
|
|
|
|
|
|
usort($files, "fileCmp"); |
|
|
|
return $files; |
|
|
|
if ($mimetype_filter) { |
|
|
|
foreach ($files as $file) { |
|
|
|
if (strpos($mimetype_filter, '/')) { |
|
|
|
if ($file['mimetype'] === $mimetype_filter) { |
|
|
|
$result[] = $file; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if ($file['mimepart'] === $mimetype_filter) { |
|
|
|
$result[] = $file; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
$result = $files; |
|
|
|
} |
|
|
|
|
|
|
|
return $result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|