Skip to content
Snippets Groups Projects
Commit bb2e68f7 authored by Thomas Müller's avatar Thomas Müller
Browse files

Fix chunk file move

parent 629bc181
No related branches found
No related tags found
No related merge requests found
...@@ -28,17 +28,19 @@ ...@@ -28,17 +28,19 @@
namespace OCA\DAV\Connector\Sabre; namespace OCA\DAV\Connector\Sabre;
use OC\Files\View; use OC\Files\View;
use OCA\DAV\Upload\FutureFile;
use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\IFile; use Sabre\DAV\IFile;
use \Sabre\DAV\PropFind; use \Sabre\DAV\PropFind;
use \Sabre\DAV\PropPatch; use \Sabre\DAV\PropPatch;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Tree; use Sabre\DAV\Tree;
use \Sabre\HTTP\RequestInterface; use \Sabre\HTTP\RequestInterface;
use \Sabre\HTTP\ResponseInterface; use \Sabre\HTTP\ResponseInterface;
use OCP\Files\StorageNotAvailableException; use OCP\Files\StorageNotAvailableException;
class FilesPlugin extends \Sabre\DAV\ServerPlugin { class FilesPlugin extends ServerPlugin {
// namespace // namespace
const NS_OWNCLOUD = 'http://owncloud.org/ns'; const NS_OWNCLOUD = 'http://owncloud.org/ns';
...@@ -146,11 +148,17 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { ...@@ -146,11 +148,17 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
/** /**
* Plugin that checks if a move can actually be performed. * Plugin that checks if a move can actually be performed.
*
* @param string $source source path * @param string $source source path
* @param string $destination destination path * @param string $destination destination path
* @throws Forbidden * @throws Forbidden
* @throws NotFound
*/ */
function checkMove($source, $destination) { function checkMove($source, $destination) {
$sourceNode = $this->server->tree->getNodeForPath($source);
if ($sourceNode instanceof FutureFile) {
return;
}
list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($source); list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($source);
list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination); list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment