Changeset 12857 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-09-14T16:19:17+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r12856 r12857 340 340 @Override 341 341 public File getPreferencesDirectory(boolean createIfMissing) { 342 if (preferencesDir != null) 343 return preferencesDir; 344 String path; 345 path = System.getProperty("josm.pref"); 346 if (path != null) { 347 preferencesDir = new File(path).getAbsoluteFile(); 348 } else { 349 path = System.getProperty("josm.home"); 342 if (preferencesDir == null) { 343 String path; 344 path = System.getProperty("josm.pref"); 350 345 if (path != null) { 351 346 preferencesDir = new File(path).getAbsoluteFile(); 352 347 } else { 353 preferencesDir = Main.platform.getDefaultPrefDirectory(); 348 path = System.getProperty("josm.home"); 349 if (path != null) { 350 preferencesDir = new File(path).getAbsoluteFile(); 351 } else { 352 preferencesDir = Main.platform.getDefaultPrefDirectory(); 353 } 354 354 } 355 355 } … … 380 380 @Override 381 381 public File getUserDataDirectory(boolean createIfMissing) { 382 if (userdataDir != null) 383 return userdataDir; 384 String path; 385 path = System.getProperty("josm.userdata"); 386 if (path != null) { 387 userdataDir = new File(path).getAbsoluteFile(); 388 } else { 389 path = System.getProperty("josm.home"); 382 if (userdataDir == null) { 383 String path; 384 path = System.getProperty("josm.userdata"); 390 385 if (path != null) { 391 386 userdataDir = new File(path).getAbsoluteFile(); 392 387 } else { 393 userdataDir = Main.platform.getDefaultUserDataDirectory(); 388 path = System.getProperty("josm.home"); 389 if (path != null) { 390 userdataDir = new File(path).getAbsoluteFile(); 391 } else { 392 userdataDir = Main.platform.getDefaultUserDataDirectory(); 393 } 394 394 } 395 395 } … … 445 445 @Override 446 446 public File getCacheDirectory(boolean createIfMissing) { 447 if (cacheDir != null) 448 return cacheDir; 449 String path = System.getProperty("josm.cache"); 450 if (path != null) { 451 cacheDir = new File(path).getAbsoluteFile(); 452 } else { 453 path = System.getProperty("josm.home"); 447 if (cacheDir == null) { 448 String path = System.getProperty("josm.cache"); 454 449 if (path != null) { 455 cacheDir = new File(path , "cache");450 cacheDir = new File(path).getAbsoluteFile(); 456 451 } else { 457 path = get("cache.folder", null);452 path = System.getProperty("josm.home"); 458 453 if (path != null) { 459 cacheDir = new File(path ).getAbsoluteFile();454 cacheDir = new File(path, "cache"); 460 455 } else { 461 cacheDir = Main.platform.getDefaultCacheDirectory(); 456 path = get("cache.folder", null); 457 if (path != null) { 458 cacheDir = new File(path).getAbsoluteFile(); 459 } else { 460 cacheDir = Main.platform.getDefaultCacheDirectory(); 461 } 462 462 } 463 463 }
Note:
See TracChangeset
for help on using the changeset viewer.