]> source.dussan.org Git - nextcloud-server.git/commitdiff
Moved default isReadable/isUpdatable impl into Common class
authorVincent Petry <pvince81@owncloud.com>
Fri, 22 Nov 2013 14:24:23 +0000 (15:24 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 22 Nov 2013 17:21:17 +0000 (18:21 +0100)
Also adjusted all ext storage backends to not override these when the
default behavior is expected.

apps/files_external/lib/amazons3.php
apps/files_external/lib/dropbox.php
apps/files_external/lib/google.php
apps/files_external/lib/sftp.php
apps/files_external/lib/streamwrapper.php
apps/files_external/lib/swift.php
apps/files_external/lib/webdav.php
lib/private/files/storage/common.php

index c08a266b48c23d36e897cae68b319af36d4963df..9a682fb2d48548696b6f862c116badf3a1d5fea2 100644 (file)
@@ -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);
 
index b6deab6e5a712e93805cc6ad2f97092e82268b05..6e464f4e28715037cb1653fc6d9056e8af74ab10 100755 (executable)
@@ -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;
index b63b5885de1ac80287c334e3e821b8c8523e7390..426caf008ecb39795c0578678090b2c667e721b4 100644 (file)
@@ -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) {
index 7c5aed5aa06b04f21e69077c28f3dc17352a6a7a..bcc4c5eafd545533bdafe33f7aede3617f896bec 100644 (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;
index a086f411f573b0005c53d82ca9df9e1699687043..23c5f91a2f33b8ab25f710f95b9b7d88f4ea4412 100644 (file)
@@ -41,19 +41,6 @@ abstract class StreamWrapper extends Common {
                return filetype($this->constructUrl($path));
        }
 
-       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 file_exists($path) {
                return file_exists($this->constructUrl($path));
        }
index bb650dacc7b0a4ae2c7c45060b1374bc29bafbd5..86938ef3bb9c59c82c450c057a61e045adc2941c 100644 (file)
@@ -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);
 
index 5857c59dcfc092ef7b72b1b8532b1560e3dc7cc7..0837222e51103f78c1dfcf44d2a45410804f53c3 100644 (file)
@@ -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);
index f99bbc9ae5e386f4015733ecfafc55c07220d60b..678bf4190239c0e3dc5e96cea7fa40d67d1b0204 100644 (file)
@@ -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;