Changeset 6581


Ignore:
Timestamp:
2004-01-22T13:52:25+13:00 (20 years ago)
Author:
jmt12
Message:

Utility has had several changes including Help stuff and Mirroring stuff.

File:
1 edited

Legend:

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

    r6565 r6581  
    480480    return col_dir + BUILD_DIR;
    481481    }
    482     /** Builds the private cache dir by appending col_dir and 'cache'.
    483      * @param col_dir A String representing the directory path of the current collection.
    484      * @return A String representing the path to the private file cache within the current collection.
    485      */
    486     public static String getCacheDir(String col_dir) {
    487     return col_dir + GCACHE_DIR;
     482    /** Builds the cache dir by appending the user path and 'cache'.
     483     * @return a File representing the path to the private file cache within the current collection.
     484     */
     485    public static File getCacheDir() {
     486    return new File(getGLIUserFolder(), StaticStrings.CACHE_FOLDER);
    488487    }
    489488    /** Method which constructs the collection directory for Greenstone.
     
    555554    }
    556555
     556    static public File getGLIUserFolder() {
     557    File gli_user_folder = new File(System.getProperty("user.home") + File.separator + ".gli" + File.separator);
     558    return gli_user_folder;
     559    }
     560
    557561    /** Retrieve the full file path to the help index xml file.
    558562     * @return the full path as a String
    559563     */
    560     static public String getHelpIndex() {
    561     String help_index = HELP_DIR + Gatherer.config.getLanguage() + File.separator + StaticStrings.HELP_INDEX_FILENAME;
    562     File help_index_file = new File(help_index);
     564    static public String getHelpFolder() {
     565    String help_folder = HELP_DIR + Gatherer.config.getLanguage() + File.separator;
     566    File help_folder_file = new File(help_folder);
    563567    // If that file can't be found, default to english
    564     if(!help_index_file.exists()) {
    565         help_index = HELP_DIR + StaticStrings.ENGLISH_LANGUAGE_STR  + File.separator + StaticStrings.HELP_INDEX_FILENAME;
    566     }
    567     return help_index;
     568    if(!help_folder_file.exists()) {
     569        help_folder = HELP_DIR + StaticStrings.ENGLISH_LANGUAGE_STR  + File.separator;
     570    }
     571    return help_folder;
    568572    }
    569573
Note: See TracChangeset for help on using the changeset viewer.