Skip to content

Commit

Permalink
Use Path instead of File to trim relative paths
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Marcionek <amarcionek@seven10storage.com>
  • Loading branch information
amarcionek committed Jan 8, 2019
1 parent 6cc9247 commit c7bb4a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/java/org/dcache/nfs/v3/MountServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import org.dcache.nfs.v3.xdr.mountres3_ok;
import org.dcache.nfs.v3.xdr.mountstat3;
import java.net.InetAddress;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -83,8 +85,8 @@ public mountres3 MOUNTPROC3_MNT_3(RpcCall call$, dirpath arg1) {

mountres3 m = new mountres3();

java.io.File f = new java.io.File(arg1.value);
String mountPoint = f.getPath().replace("\\", "/");
Path p = Paths.get(arg1.value);
String mountPoint = p.toString().replace("\\", "/");

InetAddress remoteAddress = call$.getTransport().getRemoteSocketAddress().getAddress();
_log.debug("Mount request for: {}", mountPoint);
Expand Down

0 comments on commit c7bb4a6

Please sign in to comment.