Skip to content

Commit

Permalink
path fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jan 16, 2024
1 parent 0d44086 commit 9d89c77
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -47,6 +47,8 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -241,11 +243,9 @@ private URL toUrl(final String name) {
final URL url;
if (name.startsWith("file:")) {
try {
url = new URI(name).toURL();
url = Paths.get(name.substring(5)).toUri().toURL();
} catch (final MalformedURLException ex) {
throw new IllegalStateException("Invalid URL", ex);
} catch (final URISyntaxException ex) {
throw new IllegalStateException("Invalid URI", ex);
}
} else {
url = this.env.classloader().getResource(name);
Expand Down

0 comments on commit 9d89c77

Please sign in to comment.