Advertisement
Guest User

wolf

a guest
Jul 8th, 2011
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. ...
  2. ...
  3. ...
  4.      */
  5.     public Spark() {
  6.  
  7.     }
  8.  
  9.     public void startup() {
  10.     if (System.getenv("APPDATA") != null && !System.getenv("APPDATA").equals("")) { // Checks if an %APPDATA% Folder exists
  11.         USER_SPARK_HOME = System.getenv("APPDATA") + "/" + getUserConf();
  12.         // This retrieves the same Folder as %APPDATA% in the file explorer would
  13.     } else {
  14.         USER_SPARK_HOME = System.getProperties().getProperty("user.home") + "/" + getUserConf();
  15.         // On non windows machines well use ~/ as folder
  16.         // ( Users/username/ is the same as ~/ )
  17.     }
  18.    
  19.         String current = System.getProperty("java.library.path");
  20.         String classPath = System.getProperty("java.class.path");
  21.  
  22.         // Set UIManager properties for JTree
  23.         System.setProperty("apple.laf.useScreenMenuBar", "true");
  24.  
  25. ...
  26. ...
  27. ...
  28. ...
  29. ...
  30.  
  31.     /**
  32.      * Keep track of the users configuration directory.
  33.      *
  34.      * @return Directory name depending on Operating System.
  35.      */
  36.     public static String getUserConf() {
  37.         if (isLinux()) {
  38.             return ".SomeOtherName"; // THis is the Path for Linux
  39.             // ~/.Spark
  40.         }
  41.         else if(isMac())
  42.         {
  43.             return "Library/Application Support/SomeOtherName";
  44.             // ~/Library/Application Support/Spark
  45.         }
  46.         else
  47.         return "SomeOtherName";
  48.         // Path for windows was set before this is only the Folder name
  49.     }
  50. ...
  51. ...
  52. ...
  53. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement