public void writeControlFile(String controlPath) throws IOException {
        Map<String, String> env = System.getenv();
        File controlFile = new File(env.get("control_dir"), controlPath);

        if (!controlFile.exists())
            controlFile.createNewFile();

        List<String> envProperties = getProperties();
        PrintWriter writer = new PrintWriter(new FileWriter(controlFile));
        for (String line : envProperties) {
            writer.println(line);
        }
        writer.flush();
        writer.close();
    }