Changeset 9092


Ignore:
Timestamp:
2005-02-18T10:49:48+13:00 (19 years ago)
Author:
mdewsnip
Message:

Now ensures that the GLI user directory exists for both main program and applet.

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

Legend:

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

    r9058 r9092  
    2828package org.greenstone.gatherer;
    2929
     30import java.applet.*;
    3031import java.awt.event.ActionEvent;
    3132import java.awt.event.ActionListener;
    32 import java.io.*;
    3333import java.net.*;
    3434import javax.swing.JApplet;
    35 import java.applet.*;
    3635
    3736import java.awt.*;
     37import java.io.*;
    3838import java.util.*;
    3939import javax.swing.*;
     
    9595        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    9696    }
    97     catch(Exception exception) {
     97    catch (Exception exception) {
    9898        exception.printStackTrace();
     99    }
     100
     101    // Ensure the GLI user directory exists
     102    File gli_user_directory = Utility.getGLIUserFolder();
     103    if (!gli_user_directory.exists()) {
     104        gli_user_directory.mkdirs();
    99105    }
    100106
     
    106112    gatherer = new Gatherer();
    107113
    108     String gli_user_folder = Utility.getGLIUserFolder().toString();
    109 
    110     String[] args = { "-gsdl", gli_user_folder,
     114    String[] args = { "-gsdl", gli_user_directory.toString(),
    111115              "-library", library_cgi,
    112116                    };
     
    138142    Configuration.GS3_CONFIG_XML = "config3Remote.xml";
    139143
    140     File gli_user_dir = new File(gli_user_folder);
    141     if (!gli_user_dir.exists()) {
    142         gli_user_dir.mkdirs();
    143     }
    144 
    145144    Gatherer.setCollectDirectoryPath(go.gsdl_path + "collect" + File.separator);
    146145    File col_dir = new File(Gatherer.getCollectDirectoryPath());
     
    152151    if (!metadata_directory.exists()) {
    153152        // digout metadata.zip from JAR file and unzip it
    154         Utility.unzipFromJar(Utility.METADATA_ZIP,gli_user_folder);
     153        Utility.unzipFromJar(Utility.METADATA_ZIP, gli_user_directory.toString());
    155154    }
    156155
     
    166165    }
    167166   
    168 
    169167    g_man = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path,
    170168                    go.library_url_string, go.debug, go.perl_path,
  • trunk/gli/src/org/greenstone/gatherer/GathererProg.java

    r9058 r9092  
    2929
    3030import java.awt.*;
     31import java.io.*;
    3132import java.util.*;
    3233import javax.swing.*;
    3334import org.greenstone.gatherer.feedback.ActionRecorderDialog;
    3435import org.greenstone.gatherer.gui.GUIManager;
     36import org.greenstone.gatherer.util.Utility;
    3537
    3638
     
    5456     * @see org.greenstone.gatherer.Dictionary
    5557     * @see org.greenstone.gatherer.Gatherer
    56      * @see org.greenstone.gatherer.Gatherer
    5758     */
    5859    static public void main(String[] args) {
     
    6768        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    6869    }
    69     catch(Exception exception) {
     70    catch (Exception exception) {
    7071        exception.printStackTrace();
    7172    }
    72    
     73
     74    // Ensure the GLI user directory exists
     75    File gli_user_directory = Utility.getGLIUserFolder();
     76    if (!gli_user_directory.exists()) {
     77        gli_user_directory.mkdirs();
     78    }
     79
    7380    Gatherer gatherer = new Gatherer();
    7481
Note: See TracChangeset for help on using the changeset viewer.