From e256ebefa8d17e19bd07bc502ab6582ae673dd5a Mon Sep 17 00:00:00 2001 From: Kok Wai Gie Date: Sat, 8 Oct 2022 20:32:37 +0800 Subject: [PATCH] Fixes URL encoded path returned by resource.getFile() (#8865) --- Mage/src/main/java/mage/util/ClassScanner.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Mage/src/main/java/mage/util/ClassScanner.java b/Mage/src/main/java/mage/util/ClassScanner.java index a884ab3d75..b932d78299 100644 --- a/Mage/src/main/java/mage/util/ClassScanner.java +++ b/Mage/src/main/java/mage/util/ClassScanner.java @@ -3,6 +3,8 @@ package mage.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.*; import java.util.jar.JarEntry; @@ -43,6 +45,11 @@ public final class ClassScanner { filePath = filePath.substring("file:".length(), filePath.lastIndexOf('!')); jars.add(filePath); } else { + try { + filePath = resource.toURI().getPath(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } dirs.put(filePath, packageName); } }