aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-03-22 23:20:41 -0700
committerChris Lu <chris.lu@gmail.com>2021-03-22 23:20:41 -0700
commit5a78c6ca9928585b94b4b95bfe435ff9453bd2ee (patch)
treefaa0e5211358c0177316b8eec3ade3454434fcc5
parent4abb511db30ffc01b94013434e1d941a1e22cef1 (diff)
downloadseaweedfs-5a78c6ca9928585b94b4b95bfe435ff9453bd2ee.tar.xz
seaweedfs-5a78c6ca9928585b94b4b95bfe435ff9453bd2ee.zip
Java client: support windows
-rw-r--r--other/java/client/src/main/java/seaweedfs/client/FilerClient.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/other/java/client/src/main/java/seaweedfs/client/FilerClient.java b/other/java/client/src/main/java/seaweedfs/client/FilerClient.java
index c2ffe0ac6..257a9873d 100644
--- a/other/java/client/src/main/java/seaweedfs/client/FilerClient.java
+++ b/other/java/client/src/main/java/seaweedfs/client/FilerClient.java
@@ -94,7 +94,7 @@ public class FilerClient extends FilerGrpcClient {
return true;
}
File pathFile = new File(path);
- String parent = pathFile.getParent();
+ String parent = pathFile.getParent().replace('\\','/');
String name = pathFile.getName();
mkdirs(parent, mode, uid, gid, userName, groupNames);
@@ -115,11 +115,11 @@ public class FilerClient extends FilerGrpcClient {
public boolean mv(String oldPath, String newPath) {
File oldPathFile = new File(oldPath);
- String oldParent = oldPathFile.getParent();
+ String oldParent = oldPathFile.getParent().replace('\\','/');
String oldName = oldPathFile.getName();
File newPathFile = new File(newPath);
- String newParent = newPathFile.getParent();
+ String newParent = newPathFile.getParent().replace('\\','/');
String newName = newPathFile.getName();
return atomicRenameEntry(oldParent, oldName, newParent, newName);
@@ -129,7 +129,7 @@ public class FilerClient extends FilerGrpcClient {
public boolean rm(String path, boolean isRecursive, boolean ignoreRecusiveError) {
File pathFile = new File(path);
- String parent = pathFile.getParent();
+ String parent = pathFile.getParent().replace('\\','/');
String name = pathFile.getName();
return deleteEntry(
@@ -148,7 +148,7 @@ public class FilerClient extends FilerGrpcClient {
public boolean touch(String path, int mode, int uid, int gid, String userName, String[] groupNames) {
File pathFile = new File(path);
- String parent = pathFile.getParent();
+ String parent = pathFile.getParent().replace('\\','/');
String name = pathFile.getName();
FilerProto.Entry entry = lookupEntry(parent, name);