diff options
Diffstat (limited to 'pf4j')
-rw-r--r-- | pf4j/src/main/java/org/pf4j/util/FileUtils.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pf4j/src/main/java/org/pf4j/util/FileUtils.java b/pf4j/src/main/java/org/pf4j/util/FileUtils.java index e3e8959..0c54e0a 100644 --- a/pf4j/src/main/java/org/pf4j/util/FileUtils.java +++ b/pf4j/src/main/java/org/pf4j/util/FileUtils.java @@ -43,6 +43,7 @@ import java.util.List; */ public class FileUtils { + private static final String SLASH = "/"; private static final Logger log = LoggerFactory.getLogger(FileUtils.class); public static List<String> readLines(Path path, boolean ignoreComments) throws IOException { @@ -216,7 +217,11 @@ public class FileUtils { public static Path getPath(Path path, String first, String... more) throws IOException { URI uri = path.toUri(); if (isJarFile(path)) { - uri = URI.create("jar:file:" + path.toString().replace("\\", "/")); + String pathString = path.toString().replace("\\", SLASH); + if(!pathString.startsWith(SLASH)){ + pathString = SLASH + pathString; + } + uri = URI.create("jar:file:" + pathString); } return getPath(uri, first, more); |