Ignore:
Timestamp:
2005-02-15T15:39:48+13:00 (19 years ago)
Author:
mdewsnip
Message:

Made major rearrangements to the way path variables are calculated. This is to facilitate being able to specify a "-collectdir" argument to the GLI so one GLI installation can be used in a networked, multi-user situation. Hope I haven't broken anything!

File:
1 edited

Legend:

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

    r9036 r9045  
    345345    return new File(getGLIUserFolder(), StaticStrings.CACHE_FOLDER);
    346346    }
    347     /** Method which constructs the collect directory for Greenstone.
    348      * @param gsdl_path The location of the gsdl installation directory as a <strong>String</strong>.
    349      * @return The location of the collection directory, also as a <strong>String</strong>.
    350      */
    351     public static String getCollectDir(String gsdl_path) {
    352     return gsdl_path + COL_DIR;
    353     }
    354     static public String getCollectDir(String gsdl3_path, String site_name) {
    355     return getSitesDir(gsdl3_path) + site_name + File.separator + COL_DIR;
    356     }
    357 
    358    
    359     /** Method which constructs a collection's top level directory
    360      * @@param gsdl_path The location of the gsdl installation directory as a <strong>String</strong>.
    361      * @param The name of the collection as a <strong>String</strong>.
    362      * @return The location of the collection's base directory
    363      */
    364     public static String getCollectionDir(String gsdl_path, String coll_name) {
    365     return getCollectDir(gsdl_path) + coll_name + File.separator;
    366     }
    367     public static String getCollectionDir(String gsdl3_path, String site_name, String coll_name) {
    368     return getCollectDir(gsdl3_path, site_name) + coll_name + File.separator;
    369     }
    370347
    371348   
     
    485462    }
    486463
    487     /** Method which constructs the images directory given a certain collection.
    488      * @param col_dir The location of the collection directory as a <strong>String</strong>.
    489      * @return The location of the given collections images directory, also as a <strong>String</strong>.
    490      */
    491     public static String getImagesDir(String col_dir) {
    492     return col_dir + IMAGES_DIR;
    493     }
     464
    494465    /** Method which constructs the import directory given a certain collection.
    495466     * @param col_dir The location of the collection directory as a <strong>String</strong>.
     
    709680
    710681
    711     static public void zipup(String col_name, String dir_or_file)
    712     {
    713     String col_dir = Utility.getCollectDir(Configuration.gsdl_path);
     682    static public void zipup(String col_dir, String col_name, String dir_or_file)
     683    {
    714684    int prefix_strip = col_dir.length();
    715685
     
    762732   
    763733
    764     static public void unzip(String col_name)
    765     {
    766     String col_dir = Utility.getCollectDir(Configuration.gsdl_path);
     734    static public void unzip(String col_dir, String col_name)
     735    {
    767736    String zip_fname = col_dir + col_name + ".zip";
    768737    int zip_mode = ZipFile.OPEN_READ | ZipFile.OPEN_DELETE;
Note: See TracChangeset for help on using the changeset viewer.