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
This discussion was converted from issue #293 on June 15, 2023 18:52.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried to create a folder tree such as a/b/c/d, but Sardine always don't allow: 405 or 409 error will be replied.
public boolean createFolder(String folderName) throws Exception {
try {
this.sardine.createDirectory(this.baseUrl + "/" + folderName + "/");
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public boolean createFolderTree(String folderTree, String parentFolder) throws Exception {
try {
if(Util.empty(folderTree) || folderTree.indexOf("/") < 0) {
return true;
}
String parentFirst = folderTree.substring(0, folderTree.indexOf("/"));
String subFolderTree = folderTree.substring(folderTree.indexOf("/") + 1);
if(!Util.empty(parentFirst)) {
if(!Util.empty(parentFolder)) {
createFolder(parentFolder + "/" + parentFirst);
}else {
createFolder(parentFirst);
}
}
createFolderTree(subFolderTree, parentFirst);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
`
Plz support.
Beta Was this translation helpful? Give feedback.
All reactions