コード例 #1
0
  protected static String determineSingleUserLocation() {
    String home = getUserHomeDir();
    if (home == null) {
      Logging.logger().warning("generic.UsersHomeDirectoryNotKnown");
      return null;
    }

    String path = null;

    if (gov.nasa.worldwind.Configuration.isMacOS()) {
      path = "/Library/Caches";
    } else if (gov.nasa.worldwind.Configuration.isWindowsOS()) {
      // This produces an incorrect path with duplicate parts,
      // like "C:\Users\PatC:\Users\Pat\Application Data".
      // path = System.getenv("USERPROFILE");
      // if (path == null)
      // {
      //    Logging.logger().fine("generic.UsersWindowsProfileNotKnown");
      //    return null;
      // }
      // path += "\\Application Data";

      path = "\\Application Data";
    } else if (gov.nasa.worldwind.Configuration.isLinuxOS()
        || gov.nasa.worldwind.Configuration.isUnixOS()
        || gov.nasa.worldwind.Configuration.isSolarisOS()) {
      path = "/var/cache/";
    } else {
      Logging.logger().fine("generic.UnknownOperatingSystem");
    }

    if (path == null) return null;

    return home + path;
  }
コード例 #2
0
 protected static String determineAllUserLocation() {
   if (gov.nasa.worldwind.Configuration.isMacOS()) {
     return "/Library/Caches";
   } else if (gov.nasa.worldwind.Configuration.isWindowsOS()) {
     String path = System.getenv("ALLUSERSPROFILE");
     if (path == null) {
       Logging.logger().severe("generic.AllUsersWindowsProfileNotKnown");
       return null;
     }
     return path + (Configuration.isWindows7OS() ? "" : "\\Application Data");
   } else if (gov.nasa.worldwind.Configuration.isLinuxOS()
       || gov.nasa.worldwind.Configuration.isUnixOS()
       || gov.nasa.worldwind.Configuration.isSolarisOS()) {
     return "/var/cache/";
   } else {
     Logging.logger().warning("generic.UnknownOperatingSystem");
     return null;
   }
 }