summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/Swift.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-02-12 15:08:27 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-19 19:41:16 +0100
commit817f2f8f49aec409da832219f43663793e1933a8 (patch)
tree7e4db6141f7974341937e64be8041db2209277ce /lib/private/Files/ObjectStore/Swift.php
parent3192efc415ac6d71683994afdd8f510e3480b42f (diff)
downloadnextcloud-server-817f2f8f49aec409da832219f43663793e1933a8.tar.gz
nextcloud-server-817f2f8f49aec409da832219f43663793e1933a8.zip
adjust swift external storage to new openstack sdk
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/ObjectStore/Swift.php')
-rw-r--r--lib/private/Files/ObjectStore/Swift.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index 1f93954c774..4451fbcc750 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -41,24 +41,21 @@ class Swift implements IObjectStore {
*/
private $container = null;
- /** @var SwiftConnectionFactory */
+ /** @var SwiftFactory */
private $swiftFactory;
- public function __construct($params) {
- $this->swiftFactory = new SwiftConnectionFactory(\OC::$server->getMemCacheFactory()->createDistributed('swift::'));
+ public function __construct($params, SwiftFactory $connectionFactory = null) {
+ $this->swiftFactory = $connectionFactory ?: new SwiftFactory(\OC::$server->getMemCacheFactory()->createDistributed('swift::'), $params);
$this->params = $params;
}
/**
* @return \OpenStack\ObjectStore\v1\Models\Container
* @throws StorageAuthException
- * @throws \Exception
+ * @throws \OCP\Files\StorageNotAvailableException
*/
private function getContainer() {
- if (is_null($this->container)) {
- $this->container = $this->swiftFactory->getContainer($this->params);
- }
- return $this->container;
+ return $this->swiftFactory->getContainer();
}
/**