mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-21 02:54:26 +08:00
java: resolve parent directory if started with seaweedfs://
This commit is contained in:
@@ -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