class AbstractAntExecutor {

    public void executeAntTask(final String filePath,
                               final PrintStream errorStream,
                               final PrintStream outputStream,
                               final String temporaryDir) throws APIRestGeneratorException
    {
        final File buildFile  = new File(this.generatorBuilderPath + File.separator + this.antFile);
        final Project project = this.generateProject(filePath, errorStream, outputStream, temporaryDir, buildFile);

        try
        {
            project.fireBuildStarted();
            project.init();

            final ProjectHelper projectHelper = ProjectHelper.getProjectHelper();
            project.addReference(ConstantsAnt.ANT_REF_PROJECT_HELPER, projectHelper);
            projectHelper.parse(project, buildFile);

            project.executeTarget(this.getGoalTask());
            project.fireBuildFinished(null);
        }
        catch (BuildException buildException)
        {
            project.fireBuildFinished(buildException);

            final String errorString = "BuildException while calling the ANT task with the following parameters: [antFile: " +
                                       this.antFile +
                                       ", filePath: " + filePath + "]";
            AbstractAntExecutor.LOGGER.error(errorString, buildException);
            throw new APIRestGeneratorException(errorString, buildException);
        }
    }

    public  AbstractAntExecutor(final String generatorBuilderPath,
                               final String antFile,
                               final String translatorType,
                               final String fullPkgLauncherClass,
                               final String parserType,
                               final String deliverableFileName);

}