We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecbb692 commit 7306a03Copy full SHA for 7306a03
owncloud/owncloud.py
@@ -718,6 +718,17 @@ def mkdir(self, path):
718
"""
719
if not path.endswith('/'):
720
path += '/'
721
+
722
+ path_split = list(filter(None, path.split("/")))
723
+ if len(path_split) > 1:
724
+ file_list = [x.get_name() for x in self.list(self._normalize_path("/".join(path_split[0:-1])))]
725
+ if path_split[-1] in file_list:
726
+ raise FileExistsError(f"Remote folder {path_split[-1]} exist, please check!")
727
+ else:
728
+ file_list = [x.get_name() for x in self.list(path="./")]
729
+ if path_split[0] in file_list:
730
731
732
return self._make_dav_request('MKCOL', path)
733
734
def delete(self, path):
0 commit comments