Merge branch 'master' into 14015-rename-a-file
[arvados-workbench2.git] / src / services / collection-service / collection-service.ts
index 6aa2123d0c6ac228d7e2517116807ad247791a1e..1c62ec5a68b471b89e646e6d698d99b423a421b8 100644 (file)
@@ -41,6 +41,13 @@ export class CollectionService extends CommonResourceService<CollectionResource>
         }
     }
 
+    moveFile(collectionUuid: string, oldPath: string, newPath: string) {
+        return this.webdavClient.move(
+            `/c=${collectionUuid}${oldPath}`,
+            `/c=${collectionUuid}${encodeURI(newPath)}`
+        );
+    }
+
     private extendFileURL = (file: CollectionDirectory | CollectionFile) => ({
         ...file,
         url: this.webdavClient.defaults.baseURL + file.url + '?api_token=' + this.authService.getApiToken()