support 'recursive' flag to recursively delete folders.
This commit is contained in:
		| @@ -60,11 +60,12 @@ class FolderApi(BaseApi): | ||||
|         self._raise_response_error(response) | ||||
|         return True | ||||
|  | ||||
|     def destroy(self, id: str) -> bool: | ||||
|     def destroy(self, id: str, recursive: bool) -> bool: | ||||
|         # print(self.__class__.__name__ + "::" + sys._getframe().f_code.co_name) | ||||
|         url = self.ENTRYPOINT + id + "/" | ||||
|         params = {"recursive": recursive} | ||||
|         token_check(self.connection) | ||||
|         response = self.connection.delete(url) | ||||
|         response = self.connection.delete(url, params=params) | ||||
|         self._raise_response_error(response) | ||||
|         return True | ||||
|  | ||||
|   | ||||
| @@ -36,4 +36,4 @@ class RmCommand(BaseCommand): | ||||
|             if not args.recursive: | ||||
|                 raise IllegalArgumentException(f"Cannot remove `{r_path}`: Is a folder.") | ||||
|             folder_api = FolderApi(connection) | ||||
|             folder_api.destroy(folder.id) | ||||
|             folder_api.destroy(folder.id, True) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user