Skip to content

Commit 9d89c77

Browse files
committed
path fixed
1 parent 0d44086 commit 9d89c77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

qulice-checkstyle/src/main/java/com/qulice/checkstyle/CheckstyleValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
import java.net.URI;
4848
import java.net.URISyntaxException;
4949
import java.net.URL;
50+
import java.nio.file.Path;
51+
import java.nio.file.Paths;
5052
import java.util.Collection;
5153
import java.util.LinkedList;
5254
import java.util.List;
@@ -241,11 +243,9 @@ private URL toUrl(final String name) {
241243
final URL url;
242244
if (name.startsWith("file:")) {
243245
try {
244-
url = new URI(name).toURL();
246+
url = Paths.get(name.substring(5)).toUri().toURL();
245247
} catch (final MalformedURLException ex) {
246248
throw new IllegalStateException("Invalid URL", ex);
247-
} catch (final URISyntaxException ex) {
248-
throw new IllegalStateException("Invalid URI", ex);
249249
}
250250
} else {
251251
url = this.env.classloader().getResource(name);

0 commit comments

Comments
 (0)