public static TargetDefinitionFile read(File file) throws IOException {
FileInputStream input = new FileInputStream(file);
try {
return new TargetDefinitionFile(parser.parse(new XMLIOSource(input)));
} catch (XMLParseException e) {
throw new TargetDefinitionSyntaxException("Target definition is not well-formed XML: " + e.getMessage(), e);
} finally {
IOUtil.close(input);
}
}