Skip to content

Commit

Permalink
use proper functions to create file URLs
Browse files Browse the repository at this point in the history
Fixes #315.
  • Loading branch information
lonvia committed Feb 26, 2024
1 parent ac66094 commit 1e263f8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/main/java/de/komoot/photon/elasticsearch/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import de.komoot.photon.searcher.ReverseHandler;
import de.komoot.photon.searcher.SearchHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.SystemUtils;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
Expand Down Expand Up @@ -67,11 +66,7 @@ public MyNode(Settings preparedSettings, Collection<Class<? extends Plugin>> cla

public Server(String mainDirectory) {
try {
if (SystemUtils.IS_OS_WINDOWS) {
setupDirectories(new URL("file:///" + mainDirectory));
} else {
setupDirectories(new URL("file://" + mainDirectory));
}
setupDirectories(new File(mainDirectory).toURI().toURL());
} catch (Exception e) {
throw new RuntimeException("Can't create directories: " + mainDirectory, e);
}
Expand Down

0 comments on commit 1e263f8

Please sign in to comment.