Merge pull request #5995 from owncloud/extstorage-isreadablefix

Return plausible isReadable() default impl for ext storage
remotes/origin/stable6
Vincent Petry 12 years ago
commit aef34618de
  1. 8
      apps/files_external/lib/amazons3.php
  2. 8
      apps/files_external/lib/dropbox.php
  3. 4
      apps/files_external/lib/google.php
  4. 8
      apps/files_external/lib/sftp.php
  5. 8
      apps/files_external/lib/streamwrapper.php
  6. 8
      apps/files_external/lib/swift.php
  7. 8
      apps/files_external/lib/webdav.php
  8. 13
      lib/private/files/storage/common.php

@ -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…
Cancel
Save