Skip to content

Commit 4f7640d

Browse files
committed
fix windows path handling
1 parent f611017 commit 4f7640d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/com/falsepattern/lib/internal/impl/dependencies/DependencyLoaderImpl.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@
4545

4646
import java.io.BufferedInputStream;
4747
import java.io.BufferedOutputStream;
48+
import java.io.File;
4849
import java.io.IOException;
4950
import java.io.InputStream;
5051
import java.io.InputStreamReader;
5152
import java.net.MalformedURLException;
53+
import java.net.URISyntaxException;
5254
import java.net.URL;
5355
import java.nio.file.Files;
5456
import java.nio.file.Path;
@@ -276,7 +278,13 @@ private static boolean scanForDepSpecs(URL source, List<URL> output) {
276278
LOG.error("Failed to open jar file {}", source.getPath());
277279
}
278280
} else {
279-
val dir = Paths.get(fileName);
281+
Path dir;
282+
try {
283+
dir = Paths.get(source.toURI());
284+
} catch (URISyntaxException e) {
285+
LOG.error("Could not scan URL " + source + " for dependencies", e);
286+
return false;
287+
}
280288
if (!Files.exists(dir) || !Files.isDirectory(dir)) {
281289
LOG.warn("Skipping non-directory, nor jar source: {}", source);
282290
return false;

0 commit comments

Comments
 (0)