private TargetDefinitionFile(File source, IncludeSourceMode includeSourceMode) throws TargetDefinitionSyntaxException { try { this.origin = source; this.fileContentHash = computeFileContentHash(source); this.includeSourceMode = includeSourceMode; FileInputStream input = new FileInputStream(source); try { this.document = parser.parse(new XMLIOSource(source)); this.dom = document.getRootElement(); } finally { input.close(); } } catch (XMLParseException e) { throw new TargetDefinitionSyntaxException("Target definition is not well-formed XML: " + e.getMessage(), e); } catch (IOException e) { throw new TargetDefinitionSyntaxException( "I/O error while reading target definition file: " + e.getMessage(), e); } }
private TargetDefinitionFile(File source, IncludeSourceMode includeSourceMode) throws TargetDefinitionSyntaxException { try { this.origin = source; this.fileContentHash = computeFileContentHash(source); this.includeSourceMode = includeSourceMode; FileInputStream input = new FileInputStream(source); try { this.document = parser.parse(new XMLIOSource(source)); this.dom = document.getRootElement(); } finally { input.close(); } } catch (XMLParseException e) { throw new TargetDefinitionSyntaxException("Target definition is not well-formed XML: " + e.getMessage(), e); } catch (IOException e) { throw new TargetDefinitionSyntaxException("I/O error while reading target definition file: " + e.getMessage(), e); } }
throw new XMLParseException ("Error while expanding entity "+entity+": "+e.getMessage (), e) .setToken (entityToken);