Ignore:
Timestamp:
2004-03-23T21:28:43+12:00 (20 years ago)
Author:
mdewsnip
Message:

Prevented a user home mapping being created on Windows 95/98/ME (these aren't multiuser and thus have a very poor concept of user.home).

File:
1 edited

Legend:

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

    r5898 r7112  
    44import javax.swing.filechooser.FileSystemView;
    55import org.greenstone.gatherer.Dictionary;
     6import org.greenstone.gatherer.Gatherer;
    67import org.greenstone.gatherer.file.FileNode;
    78import org.greenstone.gatherer.util.ArrayTools;
     
    4748    static public FileNode getUserHomeMapping()
    4849    {
    49     // Generate a special mapping to the user home folder
     50    // Get the name of the OS we're running on
     51    String os_name = System.getProperty("os.name");
     52    if (os_name == null) {
     53        return null;
     54    }
     55
     56    // Make sure we're running on a multiuser OS where the idea of a "user home" is valid
     57    Gatherer.println("Property os.name: " + os_name);
     58    String os_name_lc = os_name.toLowerCase();
     59    if (os_name_lc.equals("windows 95") || os_name_lc.equals("windows 98") || os_name_lc.equals("windows me")) {
     60        return null;
     61    }
     62
     63    // Get the user's home folder
    5064    String home_folder_str = System.getProperty("user.home");
    5165    if (home_folder_str == null || home_folder_str.length() == 0) {
     
    5367    }
    5468
     69    // Generate a special mapping to the user home folder
    5570    File home_folder = new File(home_folder_str);
    5671    String[] args = new String[1];
Note: See TracChangeset for help on using the changeset viewer.