summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorJesús Macias <jmacias@solidgear.es>2015-11-26 17:51:47 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-12-03 09:59:45 +0100
commit98f5c50aa47207d98d99dde97f56204ef53d066c (patch)
tree774722abdf050d43745cf0d9d330fc87f10308d9 /apps/files_external/lib
parent4ead2bc8610d11802c8814976bd80c544459235e (diff)
downloadnextcloud-server-98f5c50aa47207d98d99dde97f56204ef53d066c.tar.gz
nextcloud-server-98f5c50aa47207d98d99dde97f56204ef53d066c.zip
Migrate storate status code to storagenotavailablexception
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/config.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 1e96fac8145..7a869847a63 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -36,6 +36,7 @@ use \OCA\Files_External\Appinfo\Application;
use \OCA\Files_External\Lib\Backend\LegacyBackend;
use \OCA\Files_External\Lib\StorageConfig;
use \OCA\Files_External\Lib\Backend\Backend;
+use \OCP\Files\StorageNotAvailableException;
/**
* Class to configure mount.json globally and for users
@@ -48,11 +49,6 @@ class OC_Mount_Config {
const MOUNT_TYPE_USER = 'user';
const MOUNT_TYPE_PERSONAL = 'personal';
- // getBackendStatus return types
- const STATUS_SUCCESS = 0;
- const STATUS_ERROR = 1;
- const STATUS_INDETERMINATE = 2;
-
// whether to skip backend test (for unit tests, as this static class is not mockable)
public static $skipTest = false;
@@ -219,7 +215,7 @@ class OC_Mount_Config {
*/
public static function getBackendStatus($class, $options, $isPersonal) {
if (self::$skipTest) {
- return self::STATUS_SUCCESS;
+ return StorageNotAvailableException::STATUS_SUCCESS;
}
foreach ($options as &$option) {
$option = self::setUserVars(OCP\User::getUser(), $option);
@@ -233,7 +229,7 @@ class OC_Mount_Config {
$result = $storage->test($isPersonal);
$storage->setAvailability($result);
if ($result) {
- return self::STATUS_SUCCESS;
+ return StorageNotAvailableException::STATUS_SUCCESS;
}
} catch (\Exception $e) {
$storage->setAvailability(false);
@@ -244,7 +240,7 @@ class OC_Mount_Config {
throw $exception;
}
}
- return self::STATUS_ERROR;
+ return StorageNotAvailableException::STATUS_ERROR;
}
/**