Changeset 8670


Ignore:
Timestamp:
2004-11-25T15:04:45+13:00 (19 years ago)
Author:
mdewsnip
Message:

Fixed my changes from yesterday to store plugins.dat, classifiers.dat, and recycle bin information in the user-specific GLI folder.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r8650 r8670  
    103103
    104104    DebugStream.println("deleting classifiers.dat");
    105     File class_file = new File(Utility.getGLIUserFolder() + "classifiers.dat");
     105    File class_file = new File(Utility.getGLIUserFolder(), "classifiers.dat");
    106106    if (class_file.exists()) {
    107107        return Utility.delete(class_file);
     
    260260    private void saveClassifiers() {
    261261    try {
    262         FileOutputStream file = new FileOutputStream(Utility.getGLIUserFolder() + "classifiers.dat");
     262        File classifiers_dat_file = new File(Utility.getGLIUserFolder(), "classifiers.dat");
     263        FileOutputStream file = new FileOutputStream(classifiers_dat_file);
    263264        ObjectOutputStream out = new ObjectOutputStream(file);
    264265        out.writeObject(library);
     
    367368    private void loadClassifiers() {
    368369    // Attempt to restore the cached file.
     370    File classifiers_dat_file = new File(Utility.getGLIUserFolder(), "classifiers.dat");
    369371    try {
    370         FileInputStream file = new FileInputStream(Utility.getGLIUserFolder() + "classifiers.dat");
     372        FileInputStream file = new FileInputStream(classifiers_dat_file);
    371373        ObjectInputStream input = new ObjectInputStream(file);
    372374        library = (ArrayList) input.readObject();
    373375    }
    374376    catch (Exception error) {
    375         DebugStream.println("Unable to open "+ Utility.getGLIUserFolder() + "classifier.dat");
     377        DebugStream.println("Unable to open " + classifiers_dat_file);
    376378    }
    377379
  • trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java

    r8650 r8670  
    105105
    106106    DebugStream.println("deleting plugins.dat");
    107     File plugin_file = new File(Utility.getGLIUserFolder() + "plugins.dat");
     107    File plugin_file = new File(Utility.getGLIUserFolder(), "plugins.dat");
    108108    if (plugin_file.exists()) {
    109109        return Utility.delete(plugin_file);
     
    332332    private void savePlugins() {
    333333    try {
    334         FileOutputStream file = new FileOutputStream(Utility.getGLIUserFolder() + "plugins.dat");
     334        File plugins_dat_file = new File(Utility.getGLIUserFolder(), "plugins.dat");
     335        FileOutputStream file = new FileOutputStream(plugins_dat_file);
    335336        ObjectOutputStream out = new ObjectOutputStream(file);
    336337        out.writeObject(library);
     
    471472    private void loadPlugins() {
    472473    // Attempt to restore the cached file.
     474    File plugins_dat_file = new File(Utility.getGLIUserFolder(), "plugins.dat");
    473475    try {
    474         FileInputStream file = new FileInputStream(Utility.getGLIUserFolder() + "plugins.dat");
     476        FileInputStream file = new FileInputStream(plugins_dat_file);
    475477        ObjectInputStream input = new ObjectInputStream(file);
    476478        library = (ArrayList) input.readObject();
    477479    }
    478480    catch (Exception error) {
    479         DebugStream.println("Unable to open "+ Utility.getGLIUserFolder() + "plugins.dat");
     481        DebugStream.println("Unable to open " + plugins_dat_file);
    480482    }
    481483
  • trunk/gli/src/org/greenstone/gatherer/file/RecycleBin.java

    r8651 r8670  
    8080    setOpaque(true);
    8181
    82     this.model = new FileSystemModel(new FileNode(new File(Utility.getGLIUserFolder() + "recycle" + File.separator), "Undo"));
     82    this.model = new FileSystemModel(new FileNode(new File(Utility.getGLIUserFolder(), "recycle"), "Undo"));
    8383    }
    8484
Note: See TracChangeset for help on using the changeset viewer.