af.createEPS(outputFile);
continue;
}
-
- af.saveAlignment(file, format);
- if (af.isSaveAlignmentSuccessful())
+ FileFormatI outFormat = null;
+ try
+ {
+ outFormat = FileFormats.getInstance().forName(outputFormat);
+ } catch (Exception formatP)
{
- System.out.println("Written alignment in " + format
- + " format to " + file);
+ System.out.println("Couldn't parse " + outFormat
+ + " as a valid Jalview format string.");
}
- else
+ if (outFormat != null)
{
- System.out.println("Error writing file " + file + " in "
- + format + " format!!");
+ if (!outFormat.isWritable())
+ {
+ System.out.println(
+ "This version of Jalview does not support alignment export as "
+ + outputFormat);
+ }
+ else
+ {
+ af.saveAlignment(file, outFormat);
+ if (af.isSaveAlignmentSuccessful())
+ {
+ System.out.println("Written alignment in "
+ + outFormat.getName() + " format to " + file);
+ }
+ else
+ {
+ System.out.println("Error writing file " + file + " in "
+ + outFormat.getName() + " format!!");
+ }
+ }
}
}