Merge pull request #5995 from owncloud/extstorage-isreadablefix
Return plausible isReadable() default impl for ext storage
This commit is contained in:
commit
aef34618de
|
@ -300,14 +300,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function unlink($path) {
|
||||
$path = $this->normalizePath($path);
|
||||
|
||||
|
|
|
@ -146,14 +146,6 @@ class Dropbox extends \OC\Files\Storage\Common {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return $this->file_exists($path);
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
return $this->file_exists($path);
|
||||
}
|
||||
|
||||
public function file_exists($path) {
|
||||
if ($path == '' || $path == '/') {
|
||||
return true;
|
||||
|
|
|
@ -317,10 +317,6 @@ class Google extends \OC\Files\Storage\Common {
|
|||
}
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return $this->file_exists($path);
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
$file = $this->getDriveFile($path);
|
||||
if ($file) {
|
||||
|
|
|
@ -180,14 +180,6 @@ class SFTP extends \OC\Files\Storage\Common {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function file_exists($path) {
|
||||
try {
|
||||
return $this->client->stat($this->absPath($path)) !== false;
|
||||
|
|
|
@ -41,14 +41,6 @@ abstract class StreamWrapper extends Common {
|
|||
return filetype($this->constructUrl($path));
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return true; //not properly supported
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
return true; //not properly supported
|
||||
}
|
||||
|
||||
public function file_exists($path) {
|
||||
return file_exists($this->constructUrl($path));
|
||||
}
|
||||
|
|
|
@ -268,14 +268,6 @@ class Swift extends \OC\Files\Storage\Common {
|
|||
}
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function unlink($path) {
|
||||
$path = $this->normalizePath($path);
|
||||
|
||||
|
|
|
@ -134,14 +134,6 @@ class DAV extends \OC\Files\Storage\Common{
|
|||
}
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
return true;//not properly supported
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
return true;//not properly supported
|
||||
}
|
||||
|
||||
public function file_exists($path) {
|
||||
$this->init();
|
||||
$path=$this->cleanPath($path);
|
||||
|
|
|
@ -51,6 +51,19 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
|||
}
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
// at least check whether it exists
|
||||
// subclasses might want to implement this more thoroughly
|
||||
return $this->file_exists($path);
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
// at least check whether it exists
|
||||
// subclasses might want to implement this more thoroughly
|
||||
// a non-existing file/folder isn't updatable
|
||||
return $this->file_exists($path);
|
||||
}
|
||||
|
||||
public function isCreatable($path) {
|
||||
if ($this->is_dir($path) && $this->isUpdatable($path)) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue