|
8 | 8 | import java.net.MalformedURLException;
|
9 | 9 | import java.net.URL;
|
10 | 10 | import java.net.URLClassLoader;
|
| 11 | +import java.net.URLDecoder; |
| 12 | +import java.nio.charset.StandardCharsets; |
11 | 13 | import java.util.ArrayList;
|
12 | 14 | import java.util.Enumeration;
|
13 | 15 | import java.util.List;
|
@@ -36,7 +38,8 @@ protected static void jarInJarLoaderStart(final String[] args) throws IOExceptio
|
36 | 38 | try {
|
37 | 39 | final String currentJarUrlPath = JarInJarLoader.class.getResource(JarInJarLoader.class.getSimpleName() + ".class").toString();
|
38 | 40 | if (currentJarUrlPath != null && currentJarUrlPath.length() > 0) {
|
39 |
| - final String jarFilePath = currentJarUrlPath.substring(0, currentJarUrlPath.lastIndexOf("!")).replaceFirst("jar:file:", ""); |
| 41 | + String jarFilePath = currentJarUrlPath.substring(0, currentJarUrlPath.lastIndexOf("!")).replaceFirst("jar:file:", ""); |
| 42 | + jarFilePath = URLDecoder.decode(jarFilePath, StandardCharsets.UTF_8); |
40 | 43 | final File jarFile = new File(jarFilePath);
|
41 | 44 | if (jarFile.exists()) {
|
42 | 45 | System.getProperties().put(SYSTEM_PARAMETER_NAME_CURRENT_RUNNING_JAR, jarFile.getAbsolutePath());
|
@@ -90,6 +93,7 @@ private static ManifestInfo getManifestInfo() throws IOException {
|
90 | 93 | // find all jar files included in the jar and add them to the classpath
|
91 | 94 | rsrcClassPath = "./";
|
92 | 95 | String jarFilePath = manifestFileUrl.getFile().substring(0, manifestFileUrl.getPath().indexOf("!/META-INF/MANIFEST.MF"));
|
| 96 | + jarFilePath = URLDecoder.decode(jarFilePath, StandardCharsets.UTF_8); |
93 | 97 | if (jarFilePath.startsWith("file:")) {
|
94 | 98 | jarFilePath = jarFilePath.substring(5);
|
95 | 99 | }
|
|
0 commit comments