ソースを参照

Move locking exceptions

tags/v8.1RC2
Vincent Petry 9年前
コミット
0451a6652d
2個のファイルの変更15行の追加4行の削除
  1. 13
    4
      lib/private/connector/sabre/directory.php
  2. 2
    0
      lib/private/connector/sabre/objecttree.php

+ 13
- 4
lib/private/connector/sabre/directory.php ファイルの表示

@@ -28,6 +28,8 @@
namespace OC\Connector\Sabre;

use OC\Connector\Sabre\Exception\InvalidPath;
use OC\Connector\Sabre\Exception\FileLocked;
use OCP\Lock\LockedException;

class Directory extends \OC\Connector\Sabre\Node
implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota {
@@ -102,6 +104,8 @@ class Directory extends \OC\Connector\Sabre\Node
return $node->put($data);
} catch (\OCP\Files\StorageNotAvailableException $e) {
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
} catch (LockedException $e) {
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
}
}

@@ -127,6 +131,8 @@ class Directory extends \OC\Connector\Sabre\Node
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
} catch (\OCP\Files\InvalidPathException $ex) {
throw new InvalidPath($ex->getMessage());
} catch (LockedException $e) {
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
}
}

@@ -211,11 +217,14 @@ class Directory extends \OC\Connector\Sabre\Node
throw new \Sabre\DAV\Exception\Forbidden();
}

if (!$this->fileView->rmdir($this->path)) {
// assume it wasn't possible to remove due to permission issue
throw new \Sabre\DAV\Exception\Forbidden();
try {
if (!$this->fileView->rmdir($this->path)) {
// assume it wasn't possible to remove due to permission issue
throw new \Sabre\DAV\Exception\Forbidden();
}
} catch (LockedException $e) {
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
}

}

/**

+ 2
- 0
lib/private/connector/sabre/objecttree.php ファイルの表示

@@ -264,6 +264,8 @@ class ObjectTree extends \Sabre\DAV\Tree {
$this->fileView->copy($source, $destination);
} catch (StorageNotAvailableException $e) {
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
} catch (LockedException $e) {
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
}

list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination);

読み込み中…
キャンセル
保存