Changeset 8650
- Timestamp:
- 2004-11-24T13:30:46+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r8360 r8650 103 103 104 104 DebugStream.println("deleting classifiers.dat"); 105 File class_file = new File(Utility. BASE_DIR+ "classifiers.dat");105 File class_file = new File(Utility.getGLIUserFolder() + "classifiers.dat"); 106 106 if (class_file.exists()) { 107 107 return Utility.delete(class_file); … … 260 260 private void saveClassifiers() { 261 261 try { 262 FileOutputStream file = new FileOutputStream(Utility. BASE_DIR+ "classifiers.dat");262 FileOutputStream file = new FileOutputStream(Utility.getGLIUserFolder() + "classifiers.dat"); 263 263 ObjectOutputStream out = new ObjectOutputStream(file); 264 264 out.writeObject(library); … … 368 368 // Attempt to restore the cached file. 369 369 try { 370 FileInputStream file = new FileInputStream(Utility. BASE_DIR+ "classifiers.dat");370 FileInputStream file = new FileInputStream(Utility.getGLIUserFolder() + "classifiers.dat"); 371 371 ObjectInputStream input = new ObjectInputStream(file); 372 372 library = (ArrayList) input.readObject(); 373 373 } 374 374 catch (Exception error) { 375 DebugStream.println("Unable to open "+ Utility. BASE_DIR+ "classifier.dat");375 DebugStream.println("Unable to open "+ Utility.getGLIUserFolder() + "classifier.dat"); 376 376 } 377 377 -
trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java
r8607 r8650 105 105 106 106 DebugStream.println("deleting plugins.dat"); 107 File plugin_file = new File(Utility. BASE_DIR+ "plugins.dat");107 File plugin_file = new File(Utility.getGLIUserFolder() + "plugins.dat"); 108 108 if (plugin_file.exists()) { 109 109 return Utility.delete(plugin_file); … … 332 332 private void savePlugins() { 333 333 try { 334 FileOutputStream file = new FileOutputStream(Utility. BASE_DIR+ "plugins.dat");334 FileOutputStream file = new FileOutputStream(Utility.getGLIUserFolder() + "plugins.dat"); 335 335 ObjectOutputStream out = new ObjectOutputStream(file); 336 336 out.writeObject(library); … … 472 472 // Attempt to restore the cached file. 473 473 try { 474 FileInputStream file = new FileInputStream(Utility. BASE_DIR+ "plugins.dat");474 FileInputStream file = new FileInputStream(Utility.getGLIUserFolder() + "plugins.dat"); 475 475 ObjectInputStream input = new ObjectInputStream(file); 476 476 library = (ArrayList) input.readObject(); 477 477 } 478 478 catch (Exception error) { 479 DebugStream.println("Unable to open "+ Utility. BASE_DIR+ "plugins.dat");479 DebugStream.println("Unable to open "+ Utility.getGLIUserFolder() + "plugins.dat"); 480 480 } 481 481 -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r8622 r8650 524 524 } 525 525 526 526 527 static final private String APPLICATION_DATA_FOLDER = "Application Data"; 527 528 static final private String UNIX_GLI_CONFIG_FOLDER = ".gli"; … … 529 530 static final private String WIN_GLI_CONFIG_FOLDER = "Greenstone" + File.separator + "GLI"; 530 531 531 static public File getGLIUserFolder() {532 File gli_user_folder = null; 533 if (Utility.isWindows()) {534 gli_user_folder =new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + APPLICATION_DATA_FOLDER + File.separator + WIN_GLI_CONFIG_FOLDER + File.separator);532 static public File getGLIUserFolder() 533 { 534 if (Utility.isWindows()) { 535 return new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + APPLICATION_DATA_FOLDER + File.separator + WIN_GLI_CONFIG_FOLDER + File.separator); 535 536 } 536 537 else { 537 gli_user_folder =new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + UNIX_GLI_CONFIG_FOLDER + File.separator);538 } 539 return gli_user_folder; 540 } 538 return new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + UNIX_GLI_CONFIG_FOLDER + File.separator); 539 } 540 } 541 541 542 542 543 /** Retrieve the full file path to the help index xml file.
Note:
See TracChangeset
for help on using the changeset viewer.