@@ -0,0 +1,1143 @@
+package app;%0A%0Apublic class SystemUtils %7B%0A%0A%09/**%0A%09 * Get absolute path to user catalog data.%0A%09 */%0A%09public static String getUserCatalogAbsPath() %7B%0A%09%09String absPath = null;%0A%0A%09%09if (OsUtils.isWindows()) %7B%0A%09%09%09// get env LOCALAPPDATA - returned null in winxp%0A%09%09%09// get env PROGRAMPDATA - returned null in winxp%0A%09%09%09// get env APPDATA - returned %5BC:%5CDocuments and Settings%5CUsrName%5CApplication Data%5D path in winxp%0A%09%09%09absPath = System.getenv(%22APPDATA%22);%0A%09%09%09System.out.println(%22Win platform%22);%0A%09%09%09System.out.println(%22win env dir = %22 + absPath);%0A%0A%09%09%7D else if (OsUtils.isUnix()) %7B%0A%09%09%09absPath = System.getProperty(%22user.dir%22);%0A%09%09%09System.out.println(%22Unix%22);%0A%09%09%09System.out.println(%22user.dir = %22 + absPath);%0A%0A%09%09%7D else %7B%0A%09%09%09System.out.println(%22Not determine OS !%22);%0A%09%09%7D%0A%0A%09%09return absPath;%0A%09%7D%0A%0A%09private static final class OsUtils %7B%0A%09%09private static String OS = null;%0A%0A%09%09public static String getOsName() %7B%0A%09%09%09if(OS == null) %7B%0A%09%09%09%09OS = System.getProperty(%22os.name%22);%0A%09%09%09%7D%0A%09%09%09return OS;%0A%09%09%7D%0A%09%09public static boolean isWindows() %7B%0A%09%09%09return getOsName().startsWith(%22Windows%22);%0A%09%09%7D%0A%0A%09%09public static boolean isUnix() %7B%0A%09%09%09return getOsName().startsWith(%22Linux%22);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add util class for determine OS type and user catalog absolute path.