- Timestamp:
- 2004-01-23T09:40:26+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r6589 r6593 178 178 179 179 // Try to reload the configuration. The first place we look is the user specific location 180 File user_config_xml = null; 181 // Windows. What to do, what to do? 182 if(Utility.isWindows()) { 183 184 } 185 // Unix based systems. This one I know. Look for .gli/config.xml in the users home folder 186 else { 187 user_config_xml = new File(Utility.getGLIUserFolder(), CONFIG_XML); 188 } 180 File user_config_xml = new File(Utility.getGLIUserFolder(), CONFIG_XML); 189 181 if(user_config_xml != null && user_config_xml.exists()) { 190 182 general_config = Utility.parse(user_config_xml.getAbsolutePath(), false); … … 618 610 File user_config_xml = null; 619 611 try { 620 if(Utility.isWindows()) { 621 622 } 623 // Unix systems save user preferences in . folders in the home directory. 624 else { 625 user_config_xml = new File(Utility.getGLIUserFolder(), CONFIG_XML); 626 ///ystem.err.println("Trying to save to: " + user_config_xml.getAbsolutePath()); 627 ///ystem.err.println("Writing."); 628 user_config_xml.getParentFile().mkdirs(); 629 Utility.export(general_config, user_config_xml.getAbsolutePath()); 630 } 612 user_config_xml = new File(Utility.getGLIUserFolder(), CONFIG_XML); 613 ///ystem.err.println("Trying to save to: " + user_config_xml.getAbsolutePath()); 614 ///ystem.err.println("Writing."); 615 user_config_xml.getParentFile().mkdirs(); 616 Utility.export(general_config, user_config_xml.getAbsolutePath()); 631 617 } 632 618 catch(Exception exception) { -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r6581 r6593 554 554 } 555 555 556 static final private String APPLICATION_DATA_FOLDER = "Application Data"; 557 static final private String UNIX_GLI_CONFIG_FOLDER = ".gli"; 558 static final private String USER_HOME_PROPERTY = "user.home"; 559 static final private String WIN_GLI_CONFIG_FOLDER = "Greenstone" + File.separator + "GLI"; 560 556 561 static public File getGLIUserFolder() { 557 File gli_user_folder = new File(System.getProperty("user.home") + File.separator + ".gli" + File.separator); 562 File gli_user_folder = null; 563 if(Utility.isWindows()) { 564 gli_user_folder = new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + APPLICATION_DATA_FOLDER + File.separator + GLI_CONFIG_FOLDER + File.separator); 565 } 566 else { 567 gli_user_folder = new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + GLI_CONFIG_FOLDER + File.separator); 568 } 558 569 return gli_user_folder; 559 570 }
Note:
See TracChangeset
for help on using the changeset viewer.