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 makeFullLibName(String libName) {
    if (WWUtil.isEmpty(libName)) return null;

    if (gov.nasa.worldwind.Configuration.isWindowsOS()) {
      if (!libName.toLowerCase().endsWith(".dll")) return libName + ".dll";
    } else if (gov.nasa.worldwind.Configuration.isMacOS()) {
      if (!libName.toLowerCase().endsWith(".jnilib") && !libName.toLowerCase().startsWith("lib"))
        return "lib" + libName + ".jnilib";
    } else if (gov.nasa.worldwind.Configuration.isUnixOS()) // covers Solaris and Linux
    {
      if (!libName.toLowerCase().endsWith(".so") && !libName.toLowerCase().startsWith("lib"))
        return "lib" + libName + ".so";
    }
    return libName;
  }
 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;
   }
 }