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