From 5b50e41e7e4af09df68ac4fec28197d36a06a80e Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 6 Jul 2016 15:30:39 +1000 Subject: [PATCH 1/2] Issue #687 Alias should be absolute not relative --- .../main/java/org/eclipse/jetty/util/resource/PathResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java index 62129514ff1..b165ed46837 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java @@ -83,7 +83,7 @@ public class PathResource extends Resource try { if (Files.isSymbolicLink(path)) - return Files.readSymbolicLink(path); + return path.getParent().resolve(Files.readSymbolicLink(path)); if (Files.exists(path)) { Path real = abs.toRealPath(FOLLOW_LINKS); From fc36e457950e9269b931ecd6404c357b397ba2ca Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 6 Jul 2016 16:45:26 +1000 Subject: [PATCH 2/2] Support UNC paths in PathResource #669 Also-by: Marco Signorini Signed-off-by: Greg Wilkins --- .../java/org/eclipse/jetty/util/resource/PathResource.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java index b165ed46837..8863a648579 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java @@ -33,6 +33,7 @@ import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.LinkOption; import java.nio.file.Path; +import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.nio.file.attribute.FileTime; import java.util.ArrayList; @@ -229,7 +230,7 @@ public class PathResource extends Resource Path path; try { - path = new File(uri).toPath(); + path = Paths.get(uri); } catch (InvalidPathException e) {