class ApplicationPreprocessor {

    public void run() throws IOException, TransformerException, ParserConfigurationException, SAXException {
        DeployLogger logger = new BaseDeployLogger();
        FilesApplicationPackage.Builder applicationPackageBuilder = new FilesApplicationPackage.Builder(applicationDir);
        outputDir.ifPresent(applicationPackageBuilder::preprocessedDir);
        ApplicationPackage preprocessed = applicationPackageBuilder.build().preprocess(
                new Zone(environment.orElse(Environment.defaultEnvironment()), region.orElse(RegionName.defaultName())),
                logger);
        preprocessed.validateXML();
    }

    public  ApplicationPreprocessor(File applicationDir, Optional<File> outputDir, Optional<Environment> environment, Optional<RegionName> region);

}