}
List values = new ArrayList();
Exporter exporter = findExporter(parsedArgs, values);
if (exporter!=null && values.size()>0) {
GanttProject project = new GanttProject(false);
String inputFileName = String.valueOf(values.get(0));
project.openStartupDocument(inputFileName);
ConsoleUIFacade consoleUI = new ConsoleUIFacade(project.getUIFacade());
File inputFile = new File(inputFileName);
if (false==inputFile.exists()) {
consoleUI.showErrorDialog("File "+inputFileName+" does not exist.");
return true;
}
if (false==inputFile.canRead()) {
consoleUI.showErrorDialog("File "+inputFileName+" is not readable.");
return true;
}
Platform.getJobManager().setProgressProvider(null);
File outputFile;
if (values.size()>1) {
outputFile = new File(String.valueOf(values.get(1)));
}
else {
outputFile = FileChooserPage.proposeOutputFile(project, exporter);
}
System.err.println("[CommandLineExportApplication] export(): exporting with "+exporter);
exporter.setContext(project, consoleUI);
if (exporter instanceof ExportFileWizardImpl.LegacyOptionsClient) {
((ExportFileWizardImpl.LegacyOptionsClient)exporter).setOptions(project.getOptions());
}
try {
ExportFinalizationJob finalizationJob = new ExportFinalizationJob() {
public void run(File[] exportedFiles) {
System.exit(0);