Ignore:
Timestamp:
2005-05-16T11:28:47+12:00 (19 years ago)
Author:
davidb
Message:

Additional functionality added to GLIUserFolder. Under Windows, but default
the User's home is within "Documents and Settings/..." (usually on C: drive).
In a networked lab this means a user accessing GLI applet on a different
day on a different machine won't have the collections they built previously.
New functionality makes it possible to override where on the filesystem,
the GLIUserFolder is placed.

File:
1 edited

Legend:

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

    r9437 r9876  
    122122    static final public String XML_DIRECTORY = "xml" + File.separator;
    123123
     124    static protected File gli_user_folder = null;
     125
    124126    // These are out of alphabetic order to avoid forward reference error.
    125127    /** The default icon to produce a 'help-icon' sized blank space before a menu entry. */
     
    407409    static final private String WIN_GLI_CONFIG_FOLDER = "Greenstone" + File.separator + "GLI";
    408410
     411    static public File setGLIUserFolder(String windows_home) {
     412        gli_user_folder = null;
     413        if(Utility.isWindows()) {
     414            if ((windows_home != null) && (windows_home != "")) {
     415                gli_user_folder = new File(windows_home + File.separator + "GLI" + File.separator);
     416            }
     417            else {
     418                gli_user_folder = new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + APPLICATION_DATA_FOLDER + File.separator + WIN_GLI_CONFIG_FOLDER + File.separator);
     419            }
     420        }
     421        else {
     422            gli_user_folder = new File(System.getProperty(USER_HOME_PROPERTY) +
     423File.separator + UNIX_GLI_CONFIG_FOLDER + File.separator);
     424        }
     425        return gli_user_folder;
     426    }
     427
    409428    static public File getGLIUserFolder()
    410429    {
    411     if (Utility.isWindows()) {
    412         return new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + APPLICATION_DATA_FOLDER + File.separator + WIN_GLI_CONFIG_FOLDER + File.separator);
    413     }
    414     else {
    415         return new File(System.getProperty(USER_HOME_PROPERTY) + File.separator + UNIX_GLI_CONFIG_FOLDER + File.separator);
    416     }
     430    return gli_user_folder;
    417431    }
    418432
Note: See TracChangeset for help on using the changeset viewer.