Skip to content

Commit

Permalink
Fixed #16 Liblouis fails to initialize when there's a space in the path
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander committed Jun 5, 2019
1 parent dadd943 commit 9bf03aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/liblouis/Louis.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.nio.file.FileVisitOption;
import java.nio.file.FileVisitResult;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.NoSuchFileException;
import java.nio.file.SimpleFileVisitor;
import java.util.ArrayList;
Expand Down Expand Up @@ -420,7 +421,7 @@ static File asFile(URL url) throws IllegalArgumentException {
try {
if (!"file".equals(url.getProtocol()))
throw new RuntimeException("expected file URL");
return new File(new URI("file", url.getPath(), null));
return Paths.get(url.toURI()).toFile();
} catch (URISyntaxException e) {
throw new RuntimeException(e); // should not happen
}
Expand Down

0 comments on commit 9bf03aa

Please sign in to comment.