Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Commit 0221a4b

Browse files
lucspinscale
authored andcommitted
SecureDetectorFactory: Ensure URI windows compatibility
Closes #4
1 parent 08ba066 commit 0221a4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/cybozu/labs/langdetect/SecureDetectorFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public static void loadProfileFromClassPath(Environment environment) throws Lang
5858
try (InputStream in = FileSystemUtils.openFileURLStream(new URL("file://" + jarName))) {
5959
Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING);
6060
}
61-
FileSystem fileSystem = FileSystems.newFileSystem(new URI("jar:file://" + tmp.toAbsolutePath().toString()), Collections.emptyMap());
61+
FileSystem fileSystem =
62+
FileSystems.newFileSystem(new URI("jar:" + tmp.toAbsolutePath().toUri().toString()), Collections.emptyMap());
6263

6364
DirectoryStream<Path> ds = Files.newDirectoryStream(fileSystem.getPath("profiles/"));
6465
Iterator<Path> iter = ds.iterator();

0 commit comments

Comments
 (0)