public static String getBasePath() {
        String userName = System.getProperty("user.name");
        String s = System.getProperty("file.separator");
        String osName = System.getProperty("os.name");
        String basePath;

        if (osName.equalsIgnoreCase("windows 7")) {
            basePath = "C:" + s + "Users" + s + userName + s;
        } else if (osName.equalsIgnoreCase("windows 8")) {
            basePath = "C:" + s + "Users" + s + userName + s;
        } else if (osName.equalsIgnoreCase("windows vista")) {
            basePath = "C:" + s + "Users" + s + userName + s;
        } else if (osName.equalsIgnoreCase("windows xp")) {
            basePath = "C:" + s + "Documents and Settings" + s + userName + s + "My Documents" + s;
        } else if (osName.equalsIgnoreCase("linux")) {
            basePath = s + "home" + s + "" + userName.toLowerCase() + s;
        } else if (osName.equalsIgnoreCase("mac os") || osName.equalsIgnoreCase("mac os x")) {
            basePath = s + "Users" + s + userName.toLowerCase() + s;
        } else if (osName.equalsIgnoreCase("solaris")) {
            basePath = s + "home" + s + "" + userName.toLowerCase() + s;
        } else {
            System.err.println("Unable to determine operating system.");
            basePath = null;
        }

        return basePath;
    }