mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-30 08:50:48 +01:00
java: resolve parent directory if started with seaweedfs://
This commit is contained in:
1 parent
42e5ef4b01
commit
8c3177d835
2 files changed
+30
No files matched your search
@@ -84,6 +84,11 @@ public class SeaweedOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
public static String getParentDirectory(String path) {
|
||||
int protoIndex = path.indexOf("://");
|
||||
if (protoIndex >= 0) {
|
||||
int pathStart = path.indexOf("/", protoIndex+3);
|
||||
path = path.substring(pathStart);
|
||||
}
|
||||
if (path.equals("/")) {
|
||||
return path;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user