File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
core/src/main/java/com/graphhopper Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -748,11 +748,10 @@ public boolean load(String graphHopperFolder) {
748
748
if (fullyLoaded )
749
749
throw new IllegalStateException ("graph is already successfully loaded" );
750
750
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." );
756
755
} else {
757
756
File compressed = new File (graphHopperFolder + ".ghz" );
758
757
if (compressed .exists () && !compressed .isDirectory ()) {
You can’t perform that action at this time.
0 commit comments