Skip to content

Commit d26eaca

Browse files
authored
Fix URI decode (#9026)
1 parent 0ce97bf commit d26eaca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/jarFileTest/java/org/testcontainers/AbstractJarFileTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.testcontainers;
22

33
import java.net.URI;
4+
import java.net.URLDecoder;
5+
import java.nio.charset.StandardCharsets;
46
import java.nio.file.FileSystem;
57
import java.nio.file.FileSystems;
68
import java.nio.file.Path;
@@ -14,7 +16,8 @@ public abstract class AbstractJarFileTest {
1416
static {
1517
try {
1618
Path jarFilePath = Paths.get(System.getProperty("jarFile"));
17-
URI jarFileUri = new URI("jar", jarFilePath.toUri().toString(), null);
19+
String decodedPath = URLDecoder.decode(jarFilePath.toUri().toString(), StandardCharsets.UTF_8.name());
20+
URI jarFileUri = new URI("jar", decodedPath, null);
1821
FileSystem fileSystem = FileSystems.newFileSystem(jarFileUri, Collections.emptyMap());
1922
root = fileSystem.getPath("/");
2023
} catch (Exception e) {

0 commit comments

Comments
 (0)