diff options
-rw-r--r-- | pf4j/src/main/java/org/pf4j/util/FileUtils.java | 9 |
1 files changed, 8 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 ba9dba1..a2a1534 100644 --- a/pf4j/src/main/java/org/pf4j/util/FileUtils.java +++ b/pf4j/src/main/java/org/pf4j/util/FileUtils.java @@ -230,7 +230,14 @@ public class FileUtils { } public static Path getPath(URI uri, String first, String... more) throws IOException { - return getFileSystem(uri).getPath(first, more); + FileSystem fileSystem = getFileSystem(uri); + Path path = fileSystem.getPath(first, more); + if ("jar".equals(uri.getScheme())) { + // it's a ZipFileSystem + fileSystem.close(); + } + + return path; } public static Path findFile(Path directoryPath, String fileName) { |