Skip to content

Commit

Permalink
fix test failure when building OTP in a path with special characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Dec 18, 2024
1 parent 2d012a3 commit 2eedb12
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.List;
Expand Down Expand Up @@ -46,7 +47,12 @@ public static ResourceLoader of(Object object) {
*/
public File file(String path) {
URL resource = url(path);
var file = new File(resource.getFile());
File file;
try {
file = new File(new URI(resource.toString()));
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
assertTrue(
file.exists(),
"File '%s' not found on file system.".formatted(file.getAbsolutePath())
Expand Down

0 comments on commit 2eedb12

Please sign in to comment.