You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description" : "Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation\ndoes not overwrite anything. Renaming to any 'existing' source will return error except\nonly 1 case, with emulateMove option.\n",
634
-
"operationId" : "rename",
635
-
"parameters" : [ {
636
-
"name" : "wfsId",
637
-
"in" : "path",
638
-
"description" : "webida file system id (same to workspace id) to access.",
639
-
"required" : true,
640
-
"type" : "string"
641
-
}, {
642
-
"name" : "wfsPath",
643
-
"in" : "path",
644
-
"description" : "webida file system path to access. without heading /. should be placed at the end of path arguments\n",
645
-
"required" : true,
646
-
"type" : "string",
647
-
"pattern" : ".*"
648
-
}, {
649
-
"name" : "srcPath",
650
-
"in" : "query",
651
-
"description" : "source data path of some operations, with have heading /",
652
-
"required" : true,
653
-
"type" : "string"
654
-
}, {
655
-
"name" : "ensureParents",
656
-
"in" : "query",
657
-
"description" : "A flag to create all parent directories to create file or dir, like mkdir -p. This parameter\ndoes not create entire path, but creates to 'parent directory' of the path.\n",
658
-
"required" : false,
659
-
"type" : "boolean",
660
-
"default" : false
661
-
}, {
662
-
"name" : "emulateMove",
663
-
"in" : "query",
664
-
"description" : "When rename file to existing dir, move file to the dir instead of returning error.\nThis option is provided for legacy, dummy clients only to emulate legacy server's\nmove behaviour. Newly written client app should not use this option & use move()\noperation to have clear behaviour.\n",
665
-
"required" : false,
666
-
"type" : "boolean"
667
-
} ],
668
-
"responses" : {
669
-
"200" : {
670
-
"description" : "OK",
671
-
"schema" : {
672
-
"$ref" : "#/definitions/RestOK"
673
-
}
674
-
},
675
-
"default" : {
676
-
"description" : "Error",
677
-
"schema" : {
678
-
"$ref" : "#/definitions/RestError"
679
-
}
680
-
}
681
-
},
682
-
"security" : [ {
683
-
"webida-simple-auth" : [ ]
684
-
} ],
685
-
"x-handler" : "handlers/wfs/rename.js"
686
-
},
687
631
"put" : {
688
632
"tags" : [ "wfs" ],
689
633
"description" : "Creates / updates file with body data. Server should write the file in 'atomic' manner,\nand should not write down request body into final destination path directly. In other words,\nwheather writeFile() succeeds or not, the contents of the file should not be corrupted nor\nhalf-written.\n",
Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation does not overwrite anything. Renaming to any 'existing' source will return error except only 1 case, with emulateMove option.
386
-
387
-
### Example
388
-
```javascript
389
-
var WebidaRestfulApi =require('webida_restful_api');
390
-
var defaultClient =WebidaRestfulApi.ApiClient.default;
391
-
392
-
// Configure API key authorization: webida-simple-auth
393
-
var webida-simple-auth =defaultClient.authentications['webida-simple-auth'];
394
-
webida-simple-auth.apiKey='YOUR API KEY';
395
-
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
396
-
//webida-simple-auth.apiKeyPrefix = 'Token';
397
-
398
-
var apiInstance =newWebidaRestfulApi.WfsApi();
399
-
400
-
var wfsId ="wfsId_example"; // String | webida file system id (same to workspace id) to access.
401
-
402
-
var wfsPath ="wfsPath_example"; // String | webida file system path to access. without heading /. should be placed at the end of path arguments
403
-
404
-
var srcPath ="srcPath_example"; // String | source data path of some operations, with have heading /
405
-
406
-
var opts = {
407
-
'ensureParents':false, // Boolean | A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path.
408
-
'emulateMove':true// Boolean | When rename file to existing dir, move file to the dir instead of returning error. This option is provided for legacy, dummy clients only to emulate legacy server's move behaviour. Newly written client app should not use this option & use move() operation to have clear behaviour.
409
-
};
410
-
411
-
varcallback=function(error, data, response) {
412
-
if (error) {
413
-
console.error(error);
414
-
} else {
415
-
console.log('API called successfully. Returned data: '+ data);
**wfsId** | **String**| webida file system id (same to workspace id) to access. |
426
-
**wfsPath** | **String**| webida file system path to access. without heading /. should be placed at the end of path arguments |
427
-
**srcPath** | **String**| source data path of some operations, with have heading / |
428
-
**ensureParents** | **Boolean**| A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path. | [optional][default to false]
429
-
**emulateMove** | **Boolean**| When rename file to existing dir, move file to the dir instead of returning error. This option is provided for legacy, dummy clients only to emulate legacy server's move behaviour. Newly written client app should not use this option & use move() operation to have clear behaviour. | [optional]
363
+
**noRecursive** | **Boolean**| if set, deleting non-empty directory will return 409 error. | [optional][default to false]
430
364
431
365
### Return type
432
366
@@ -529,7 +463,7 @@ var wfsPath = "wfsPath_example"; // String | webida file system path to access.
529
463
var data ="/path/to/file.txt"; // File | file contents to write.
530
464
531
465
var opts = {
532
-
'ensureParents':false,// Boolean | A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path.
466
+
'ensureParents':false// Boolean | A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path.
Copy file name to clipboardExpand all lines: src/api/WfsApi.js
+2-67Lines changed: 2 additions & 67 deletions
Original file line number
Diff line number
Diff line change
@@ -362,7 +362,7 @@
362
362
* @param {String} wfsId webida file system id (same to workspace id) to access.
363
363
* @param {String} wfsPath webida file system path to access. without heading /. should be placed at the end of path arguments
364
364
* @param {Object} opts Optional parameters
365
-
* @param {Boolean} opts.unrecursive if set, deleting non-empty directory will return error. (default to false)
365
+
* @param {Boolean} opts.noRecursive if set, deleting non-empty directory will return 409 error. (default to false)
366
366
* @param {module:api/WfsApi~removeCallback} callback The callback function, accepting three arguments: error, data, response
367
367
* data is of type: {module:model/RestOK}
368
368
*/
@@ -386,7 +386,7 @@
386
386
'wfsPath': wfsPath
387
387
};
388
388
varqueryParams={
389
-
'unrecursive': opts['unrecursive']
389
+
'noRecursive': opts['noRecursive']
390
390
};
391
391
varheaderParams={
392
392
};
@@ -405,71 +405,6 @@
405
405
);
406
406
}
407
407
408
-
/**
409
-
* Callback function to receive the result of the rename operation.
410
-
* @callback module:api/WfsApi~renameCallback
411
-
* @param {String} error Error message, if any.
412
-
* @param {module:model/RestOK} data The data returned by the service call.
413
-
* @param {String} response The complete HTTP response.
414
-
*/
415
-
416
-
/**
417
-
* Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation does not overwrite anything. Renaming to any 'existing' source will return error except only 1 case, with emulateMove option.
418
-
* @param {String} wfsId webida file system id (same to workspace id) to access.
419
-
* @param {String} wfsPath webida file system path to access. without heading /. should be placed at the end of path arguments
420
-
* @param {String} srcPath source data path of some operations, with have heading /
421
-
* @param {Object} opts Optional parameters
422
-
* @param {Boolean} opts.ensureParents A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path. (default to false)
423
-
* @param {Boolean} opts.emulateMove When rename file to existing dir, move file to the dir instead of returning error. This option is provided for legacy, dummy clients only to emulate legacy server's move behaviour. Newly written client app should not use this option & use move() operation to have clear behaviour.
424
-
* @param {module:api/WfsApi~renameCallback} callback The callback function, accepting three arguments: error, data, response
0 commit comments