Skip to content

Commit f73a689

Browse files
committed
avoid fallback to folder-gh, no graphhopper.sh script necessary, fixes graphhopper#805
1 parent 4ef5b74 commit f73a689

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/src/main/java/com/graphhopper/GraphHopper.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,10 @@ public boolean load(String graphHopperFolder) {
748748
if (fullyLoaded)
749749
throw new IllegalStateException("graph is already successfully loaded");
750750

751-
if (graphHopperFolder.endsWith("-gh")) {
752-
// do nothing
753-
} else if (!graphHopperFolder.contains(".")) {
754-
if (new File(graphHopperFolder + "-gh").exists())
755-
graphHopperFolder += "-gh";
751+
File tmpFileOrFolder = new File(graphHopperFolder);
752+
753+
if (!tmpFileOrFolder.isDirectory() && tmpFileOrFolder.exists()) {
754+
throw new IllegalArgumentException("GraphHopperLocation cannot be an existing file. Has to be either non-existing or a folder.");
756755
} else {
757756
File compressed = new File(graphHopperFolder + ".ghz");
758757
if (compressed.exists() && !compressed.isDirectory()) {

0 commit comments

Comments
 (0)