From 19c7eabf537e5805be25454e241d138d306ca2f3 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Sun, 4 Feb 2018 13:01:18 +0100 Subject: Correcting the isInJar test --- src/main/java/fr/umlv/java/wallj/viewer/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/fr') diff --git a/src/main/java/fr/umlv/java/wallj/viewer/Main.java b/src/main/java/fr/umlv/java/wallj/viewer/Main.java index d74785c..291ad58 100644 --- a/src/main/java/fr/umlv/java/wallj/viewer/Main.java +++ b/src/main/java/fr/umlv/java/wallj/viewer/Main.java @@ -18,7 +18,7 @@ public class Main { private static final String DEFAULT_MAP_NAME = "/maps/level0.txt"; private static FileSystem fileSystemForContext(URI uri) throws URISyntaxException, IOException { - boolean isInJar = Objects.equals(Main.class.getProtectionDomain().getCodeSource().getLocation().getProtocol(), "jar"); + boolean isInJar = Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().toString().endsWith(".jar"); if (isInJar) {//JAR from command line handling Map env = new HashMap<>(); env.put("create", "true"); -- cgit v1.2.3