public static File getWorkPath(String workDir){
        String userHome = System.getProperty("user.home", ".");
        File workingDirectory;
        switch (getPlatform().ordinal()) {
            case 0:
            case 1:
                workingDirectory = new File(userHome, '.' + workDir + '/');
                break;
            case 2:
                String applicationData = System.getenv("APPDATA");
                if (applicationData != null)
                    workingDirectory = new File(applicationData, "." + workDir + '/');
                else
                    workingDirectory = new File(userHome, '.' + workDir + '/');
                break;
            case 3:
                workingDirectory = new File(userHome, "Library/Application Support/" + workDir);
                break;
            default:
                workingDirectory = new File(userHome, workDir + '/');
        }
        if ((!workingDirectory.exists()) && (!workingDirectory.mkdirs()))
            throw new RuntimeException("The working directory could not be created: " + workingDirectory);
        return workingDirectory;
    }