]> source.dussan.org Git - nextcloud-server.git/commitdiff
move to public namespace
authorMorris Jobke <hey@morrisjobke.de>
Tue, 19 Aug 2014 12:05:08 +0000 (14:05 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Tue, 19 Aug 2014 12:05:08 +0000 (14:05 +0200)
12 files changed:
apps/files_external/lib/google.php
apps/files_sharing/lib/sharedstorage.php
lib/private/connector/sabre/quotaplugin.php
lib/private/files/filesystem.php
lib/private/files/storage/common.php
lib/private/files/storage/dav.php
lib/private/files/storage/local.php
lib/private/files/storage/wrapper/quota.php
lib/private/helper.php
lib/private/util.php
lib/public/files/fileinfo.php
tests/lib/connector/sabre/quotaplugin.php

index e653050c5b3ee8bc009b271626795740a8ff6c67..88d82d51e2e81b0169b7d9ee762e93205f0d223e 100644 (file)
@@ -286,7 +286,7 @@ class Google extends \OC\Files\Storage\Common {
                                // Check if this is a Google Doc
                                if ($this->getMimeType($path) !== $file->getMimeType()) {
                                        // Return unknown file size
-                                       $stat['size'] = \OC\Files\Filesystem::SPACE_UNKNOWN;
+                                       $stat['size'] = \OCP\Files\FileInfo::SPACE_UNKNOWN;
                                } else {
                                        $stat['size'] = $file->getFileSize();
                                }
index 4b9be4109e993948e7c3663e24cb8d83bd86e7d6..07f6b9da10c820599ae18ab0674e9ec5e89837be 100644 (file)
@@ -377,7 +377,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
                        list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source);
                        return $storage->free_space($internalPath);
                }
-               return \OC\Files\Filesystem::SPACE_UNKNOWN;
+               return \OCP\Files\FileInfo::SPACE_UNKNOWN;
        }
 
        public function getLocalFile($path) {
index a215a772c0323621e3b4aea4f3e0449b3b8d86fa..ebcc894d7446c1e67ecc96b5c06fd32718767311 100644 (file)
@@ -72,7 +72,7 @@ class OC_Connector_Sabre_QuotaPlugin extends \Sabre\DAV\ServerPlugin {
                                $length -= $chunkHandler->getCurrentSize();
                        }
                        $freeSpace = $this->getFreeSpace($parentUri);
-                       if ($freeSpace !== \OC\Files\Filesystem::SPACE_UNKNOWN && $length > $freeSpace) {
+                       if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN && $length > $freeSpace) {
                                if (isset($chunkHandler)) {
                                        $chunkHandler->cleanup();
                                }
index 758a178088c1fa285b0e0d8e5aa1fcbe4812fc61..1dbe66143acdba4378bcab680b6ef5e5c4c39e34 100644 (file)
@@ -33,9 +33,6 @@ namespace OC\Files;
 use OC\Files\Storage\Loader;
 
 class Filesystem {
-       const SPACE_NOT_COMPUTED = -1;
-       const SPACE_UNKNOWN = -2;
-       const SPACE_UNLIMITED = -3;
 
        /**
         * @var Mount\Manager $mounts
index 08c892cb7fef737809181e9a10f0e212a446372d..4799c86514236920b12e3d00fdb96006298f92ac 100644 (file)
@@ -398,7 +398,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
         * @return int
         */
        public function free_space($path) {
-               return \OC\Files\Filesystem::SPACE_UNKNOWN;
+               return \OCP\Files\FileInfo::SPACE_UNKNOWN;
        }
 
        /**
index 93036b8ca44586ba77497a7a0ec8f70b549925db..bd7166c9823950de0857eb0d6978ec35310c4e5c 100644 (file)
@@ -243,10 +243,10 @@ class DAV extends \OC\Files\Storage\Common {
                        if (isset($response['{DAV:}quota-available-bytes'])) {
                                return (int)$response['{DAV:}quota-available-bytes'];
                        } else {
-                               return \OC\Files\Filesystem::SPACE_UNKNOWN;
+                               return \OCP\Files\FileInfo::SPACE_UNKNOWN;
                        }
                } catch (\Exception $e) {
-                       return \OC\Files\Filesystem::SPACE_UNKNOWN;
+                       return \OCP\Files\FileInfo::SPACE_UNKNOWN;
                }
        }
 
index eeb7af5cd08f8dea4a8a4392509af6429e5f3f49..9df6cdef2afcdb01fd4ec40d2e4e5991258f2b68 100644 (file)
@@ -218,7 +218,7 @@ if (\OC_Util::runningOnWindows()) {
                public function free_space($path) {
                        $space = @disk_free_space($this->datadir . $path);
                        if ($space === false || is_null($space)) {
-                               return \OC\Files\Filesystem::SPACE_UNKNOWN;
+                               return \OCP\Files\FileInfo::SPACE_UNKNOWN;
                        }
                        return $space;
                }
index f9157ba84f4a824531438ed7aa37e6b7e088817a..bf169e41f13ca52c51c5155f96b98b5c9607aab6 100644 (file)
@@ -50,7 +50,7 @@ class Quota extends Wrapper {
                        }
                        return $data['size'];
                } else {
-                       return \OC\Files\Filesystem::SPACE_NOT_COMPUTED;
+                       return \OCP\Files\FileInfo::SPACE_NOT_COMPUTED;
                }
        }
 
@@ -66,7 +66,7 @@ class Quota extends Wrapper {
                } else {
                        $used = $this->getSize($this->sizeRoot);
                        if ($used < 0) {
-                               return \OC\Files\Filesystem::SPACE_NOT_COMPUTED;
+                               return \OCP\Files\FileInfo::SPACE_NOT_COMPUTED;
                        } else {
                                $free = $this->storage->free_space($path);
                                $quotaFree = max($this->quota - $used, 0);
index 840869e58c4aa7c02732f013d14dc7939c5170e0..17d3840a3ea5ac780e707d107ac4003941b73eee 100644 (file)
@@ -887,7 +887,7 @@ class OC_Helper {
         */
        public static function freeSpace($dir) {
                $freeSpace = \OC\Files\Filesystem::free_space($dir);
-               if ($freeSpace !== \OC\Files\Filesystem::SPACE_UNKNOWN) {
+               if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) {
                        $freeSpace = max($freeSpace, 0);
                        return $freeSpace;
                } else {
@@ -960,7 +960,7 @@ class OC_Helper {
                }
                if ($includeExtStorage) {
                        $quota = OC_Util::getUserQuota(\OCP\User::getUser());
-                       if ($quota !== \OC\Files\Filesystem::SPACE_UNLIMITED) {
+                       if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
                                // always get free space / total space from root + mount points
                                $path = '';
                                return self::getGlobalStorageInfo();
index 28cc87bfddd383c913ff75232134a790c7773328..82c5acee6702fd604f7a674462318e204fb70531 100755 (executable)
@@ -105,7 +105,7 @@ class OC_Util {
                                        if (is_object($storage->getUser())) {
                                                $user = $storage->getUser()->getUID();
                                                $quota = OC_Util::getUserQuota($user);
-                                               if ($quota !== \OC\Files\Filesystem::SPACE_UNLIMITED) {
+                                               if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
                                                        return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files'));
                                                }
                                        }
@@ -1244,7 +1244,7 @@ class OC_Util {
                if (strpos($url, 'http://') !== 0 && strpos($url, 'https://') !== 0) {
                        throw new Exception('$url must start with https:// or http://', 1);
                }
-               
+
                if (function_exists('curl_init')) {
                        $curl = curl_init();
                        $max_redirects = 10;
index b9c8258f21eee7bf364468b39e2e31bae5d67a9b..ece4409ca5501a1e7b766c5b766206598a3252b6 100644 (file)
@@ -11,6 +11,10 @@ interface FileInfo {
        const TYPE_FILE = 'file';
        const TYPE_FOLDER = 'dir';
 
+       const SPACE_NOT_COMPUTED = -1;
+       const SPACE_UNKNOWN = -2;
+       const SPACE_UNLIMITED = -3;
+
        /**
         * Get the Etag of the file or folder
         *
index 1024ae6af8f0b9d750fdc04ba7a0ce3063d0d008..3b144cf56b5213a4285bf03a305772a22b58a9f6 100644 (file)
@@ -63,7 +63,7 @@ class Test_OC_Connector_Sabre_QuotaPlugin extends PHPUnit_Framework_TestCase {
                        array(1024, array('HTTP_X_EXPECTED_ENTITY_LENGTH' => '1024')),
                        array(1024, array('HTTP_CONTENT_LENGTH' => '512')),
                        array(1024, array('HTTP_OC_TOTAL_LENGTH' => '1024', 'HTTP_CONTENT_LENGTH' => '512')),
-                       // OC\Files\FREE_SPACE_UNKNOWN = -2
+                       // \OCP\Files\FileInfo::SPACE_UNKNOWN = -2
                        array(-2, array()),
                        array(-2, array('HTTP_X_EXPECTED_ENTITY_LENGTH' => '1024')),
                        array(-2, array('HTTP_CONTENT_LENGTH' => '512')),