public static void main(String[] args) throws IOException {
        String fileName = args[0];
        if (!fileName.endsWith(PROPERTIES_FILE)) {
            throw new IllegalArgumentException("Expected '" + PROPERTIES_FILE + "', got '" + fileName + "'.");
        }
        String exportPackages = getExportPackages(args);
        Properties props = new Properties();
        props.setProperty(EXPORT_PACKAGES, exportPackages);

        try (FileWriter writer = new FileWriter(new File(fileName))) {
            props.store(writer, "generated by " + ExportPackages.class.getName());
        }
    }
@author Simon Thoresen Hult
@author gjoranv
jdisc_core/src/main/java/com/yahoo/jdisc/core/ExportPackages.java