summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/api.php6
-rw-r--r--apps/files_external/lib/smb.php1
-rw-r--r--apps/files_external/lib/storageconfig.php4
-rw-r--r--apps/files_external/lib/swift.php11
4 files changed, 16 insertions, 6 deletions
diff --git a/apps/files_external/lib/api.php b/apps/files_external/lib/api.php
index af9b802e522..f0c9e568c9e 100644
--- a/apps/files_external/lib/api.php
+++ b/apps/files_external/lib/api.php
@@ -28,7 +28,7 @@ class Api {
/**
* Formats the given mount config to a mount entry.
- *
+ *
* @param string $mountPoint mount point name, relative to the data dir
* @param array $mountConfig mount config to format
*
@@ -59,7 +59,9 @@ class Api {
'type' => 'dir',
'backend' => $mountConfig['backend'],
'scope' => ( $isSystemMount ? 'system' : 'personal' ),
- 'permissions' => $permissions
+ 'permissions' => $permissions,
+ 'id' => $mountConfig['id'],
+ 'class' => $mountConfig['class']
);
return $entry;
}
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index f58cd9849f2..a94840ead59 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -33,7 +33,6 @@ use Icewind\SMB\Exception\Exception;
use Icewind\SMB\Exception\NotFoundException;
use Icewind\SMB\NativeServer;
use Icewind\SMB\Server;
-use Icewind\Streams\CallbackWrapper;
use Icewind\Streams\IteratorDirectory;
use OC\Files\Filesystem;
diff --git a/apps/files_external/lib/storageconfig.php b/apps/files_external/lib/storageconfig.php
index 97e0386be73..49a40a9a5d7 100644
--- a/apps/files_external/lib/storageconfig.php
+++ b/apps/files_external/lib/storageconfig.php
@@ -163,7 +163,7 @@ class StorageConfig implements \JsonSerializable {
}
/**
- * @param Backend
+ * @param Backend $backend
*/
public function setBackend(Backend $backend) {
$this->backend= $backend;
@@ -177,7 +177,7 @@ class StorageConfig implements \JsonSerializable {
}
/**
- * @param AuthMechanism
+ * @param AuthMechanism $authMechanism
*/
public function setAuthMechanism(AuthMechanism $authMechanism) {
$this->authMechanism = $authMechanism;
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index e946e7feb77..a64a02a4ed9 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -354,9 +354,18 @@ class Swift extends \OC\Files\Storage\Common {
}
$tmpFile = \OCP\Files::tmpFile($ext);
\OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack'));
- if ($this->file_exists($path)) {
+ // Fetch existing file if required
+ if ($mode[0] !== 'w' && $this->file_exists($path)) {
+ if ($mode[0] === 'x') {
+ // File cannot already exist
+ return false;
+ }
$source = $this->fopen($path, 'r');
file_put_contents($tmpFile, $source);
+ // Seek to end if required
+ if ($mode[0] === 'a') {
+ fseek($tmpFile, 0, SEEK_END);
+ }
}
self::$tmpFiles[$tmpFile] = $path;