Skip to content

Commit

Permalink
Fix URI decode (#9026)
Browse files Browse the repository at this point in the history
  • Loading branch information
simpletasks committed Jul 29, 2024
1 parent 0ce97bf commit d26eaca
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.testcontainers;

import java.net.URI;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
Expand All @@ -14,7 +16,8 @@ public abstract class AbstractJarFileTest {
static {
try {
Path jarFilePath = Paths.get(System.getProperty("jarFile"));
URI jarFileUri = new URI("jar", jarFilePath.toUri().toString(), null);
String decodedPath = URLDecoder.decode(jarFilePath.toUri().toString(), StandardCharsets.UTF_8.name());
URI jarFileUri = new URI("jar", decodedPath, null);
FileSystem fileSystem = FileSystems.newFileSystem(jarFileUri, Collections.emptyMap());
root = fileSystem.getPath("/");
} catch (Exception e) {
Expand Down

0 comments on commit d26eaca

Please sign in to comment.