Changeset 7841 in josm
- Timestamp:
- 2014-12-19T22:34:37+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r7834 r7841 94 94 */ 95 95 private File cacheDir = null; 96 97 /** 98 * Internal storage for the user data directory. 99 */ 100 private File userdataDir = null; 96 101 97 102 /** … … 552 557 return preferencesDir; 553 558 String path; 554 path = System.getProperty("josm. home");559 path = System.getProperty("josm.pref"); 555 560 if (path != null) { 556 561 preferencesDir = new File(path).getAbsoluteFile(); 557 562 } else { 558 preferencesDir = Main.platform.getDefaultPrefDirectory(); 563 path = System.getProperty("josm.home"); 564 if (path != null) { 565 preferencesDir = new File(path).getAbsoluteFile(); 566 } else { 567 preferencesDir = Main.platform.getDefaultPrefDirectory(); 568 } 559 569 } 560 570 return preferencesDir; … … 568 578 */ 569 579 public File getUserDataDirectory() { 570 return Main.platform.getDefaultUserDataDirectory(); 580 if (userdataDir != null) 581 return userdataDir; 582 String path; 583 path = System.getProperty("josm.userdata"); 584 if (path != null) { 585 userdataDir = new File(path).getAbsoluteFile(); 586 } else { 587 path = System.getProperty("josm.home"); 588 if (path != null) { 589 userdataDir = new File(path).getAbsoluteFile(); 590 } else { 591 userdataDir = Main.platform.getDefaultUserDataDirectory(); 592 } 593 } 594 return userdataDir; 571 595 } 572 596 … … 602 626 cacheDir = new File(path).getAbsoluteFile(); 603 627 } else { 604 path = get("cache.folder", null);628 path = System.getProperty("josm.home"); 605 629 if (path != null) { 606 cacheDir = new File(path );630 cacheDir = new File(path, "cache"); 607 631 } else { 608 cacheDir = Main.platform.getDefaultCacheDirectory(); 632 path = get("cache.folder", null); 633 if (path != null) { 634 cacheDir = new File(path).getAbsoluteFile(); 635 } else { 636 cacheDir = Main.platform.getDefaultCacheDirectory(); 637 } 609 638 } 610 639 }
Note:
See TracChangeset
for help on using the changeset viewer.