List of usage examples for org.apache.commons.digester3 Digester parse
public <T> T parse(URL url) throws IOException, SAXException
From source file:org.azkfw.datasource.xml.XmlDatasourceBuilder.java
/** * ?//from ww w .ja v a 2 s .c o m * * @return * @throws FileNotFoundException * @throws ParseException * @throws IOException */ @SuppressWarnings({ "unchecked", "rawtypes" }) public Datasource build() throws FileNotFoundException, ParseException, IOException { XmlDatasource datasource = new XmlDatasource(); datasource.name = datasourceName; InputStream stream = null; try { List<XmlTable> tables = new ArrayList<XmlTable>(); for (File file : xmlFiles) { List<XmlTableEntity> tableList = null; stream = new FileInputStream(file); Digester digester = new Digester(); digester.addObjectCreate("datasource/tables", ArrayList.class); digester.addObjectCreate("datasource/tables/table", XmlTableEntity.class); digester.addSetProperties("datasource/tables/table"); digester.addSetNext("datasource/tables/table", "add"); digester.addObjectCreate("datasource/tables/table/fields", ArrayList.class); digester.addSetNext("datasource/tables/table/fields", "setFields"); digester.addObjectCreate("datasource/tables/table/fields/field", XmlFieldEntity.class); digester.addSetProperties("datasource/tables/table/fields/field"); digester.addSetNext("datasource/tables/table/fields/field", "add"); digester.addObjectCreate("datasource/tables/table/records", ArrayList.class); digester.addSetNext("datasource/tables/table/records", "setRecords"); digester.addObjectCreate("datasource/tables/table/records/record", XmlRecordEntity.class); digester.addSetNext("datasource/tables/table/records/record", "add"); digester.addObjectCreate("datasource/tables/table/records/record/data", XmlRecordDataEntity.class); digester.addSetProperties("datasource/tables/table/records/record/data"); digester.addSetNext("datasource/tables/table/records/record/data", "add"); tableList = digester.parse(stream); for (XmlTableEntity t : tableList) { XmlTable table = new XmlTable(); table.label = t.label; table.name = t.name; // Read Field List<XmlField> fields = new ArrayList<XmlField>(); for (int col = 0; col < t.fields.size(); col++) { XmlFieldEntity f = t.fields.get(col); XmlField field = readField(col, f); fields.add(field); } // Read Data List<XmlRecord> records = new ArrayList<XmlRecord>(); for (int row = 0; row < t.records.size(); row++) { XmlRecordEntity r = t.records.get(row); if (r.data.size() == fields.size()) { XmlRecord record = readData(row, r, fields); records.add(record); } else { System.out.println("Skip row(unmatch field count).[table: " + table.getName() + "; row: " + r + ";]"); } } table.fields = (List) fields; table.records = (List) records; tables.add(table); } } datasource.tables = (List) tables; } catch (SAXException ex) { throw new ParseException(ex.getMessage(), -1); } catch (IOException ex) { throw ex; } finally { if (null != stream) { try { stream.close(); } catch (Exception ex) { ex.printStackTrace(); } } } return datasource; }
From source file:org.azkfw.datasource.xml.XmlDatasourceFactory.java
/** * XML???//from w w w .ja va 2 s . c om * * @param aName ?? * @param aFile XML * @return */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static Datasource generate(final String aName, final File aFile) throws FileNotFoundException, ParseException, IOException { XmlDatasource datasource = new XmlDatasource(); datasource.name = aName; List<XmlTableEntity> tableList = null; InputStream stream = null; try { stream = new FileInputStream(aFile); Digester digester = new Digester(); digester.addObjectCreate("datasource/tables", ArrayList.class); digester.addObjectCreate("datasource/tables/table", XmlTableEntity.class); digester.addSetProperties("datasource/tables/table"); digester.addSetNext("datasource/tables/table", "add"); digester.addObjectCreate("datasource/tables/table/fields", ArrayList.class); digester.addSetNext("datasource/tables/table/fields", "setFields"); digester.addObjectCreate("datasource/tables/table/fields/field", XmlFieldEntity.class); digester.addSetProperties("datasource/tables/table/fields/field"); digester.addSetNext("datasource/tables/table/fields/field", "add"); digester.addObjectCreate("datasource/tables/table/records", ArrayList.class); digester.addSetNext("datasource/tables/table/records", "setRecords"); digester.addObjectCreate("datasource/tables/table/records/record", XmlRecordEntity.class); digester.addSetNext("datasource/tables/table/records/record", "add"); digester.addObjectCreate("datasource/tables/table/records/record/data", XmlRecordDataEntity.class); digester.addSetProperties("datasource/tables/table/records/record/data"); digester.addSetNext("datasource/tables/table/records/record/data", "add"); tableList = digester.parse(stream); } catch (SAXException ex) { throw new ParseException(ex.getMessage(), -1); } catch (IOException ex) { throw ex; } finally { if (null != stream) { try { stream.close(); } catch (Exception ex) { ex.printStackTrace(); } } } List<XmlTable> tables = new ArrayList<XmlTable>(); for (XmlTableEntity t : tableList) { XmlTable table = new XmlTable(); table.label = t.label; table.name = t.name; // Read Field List<XmlField> fields = new ArrayList<XmlField>(); for (int col = 0; col < t.fields.size(); col++) { XmlFieldEntity f = t.fields.get(col); XmlField field = readField(col, f); fields.add(field); } // Read Data List<XmlRecord> records = new ArrayList<XmlRecord>(); for (int row = 0; row < t.records.size(); row++) { XmlRecordEntity r = t.records.get(row); if (r.data.size() == fields.size()) { XmlRecord record = readData(row, r, fields); records.add(record); } else { System.out.println( "Skip row(unmatch field count).[table: " + table.getName() + "; row: " + r + ";]"); } } table.fields = (List) fields; table.records = (List) records; tables.add(table); } datasource.tables = (List) tables; return datasource; }
From source file:org.efaps.maven.jetty.configuration.ServerDefinition.java
/** * Initializes a new instanc of the server definition a a XML file. * * @param _url path to the XML file within the server definition * @return configured instance from the XML file */// www . jav a2 s .com public static ServerDefinition read(final String _url) { ServerDefinition ret = null; try { final DigesterLoader loader = DigesterLoader.newLoader(new AbstractRulesModule() { @Override protected void configure() { forPattern("server").createObject().ofType(ServerDefinition.class).then().setProperties(); forPattern("server/parameter").callMethod("addIniParam").withParamCount(2) .withParamTypes(String.class, String.class).then().callParam().fromAttribute("key") .ofIndex(0).then().callParam().ofIndex(1); forPattern("server/filter").createObject().ofType(FilterDefinition.class).then() .setNext("addFilter"); forPattern("server/filter").setProperties(); forPattern("server/filter/parameter").callMethod("addIniParam").withParamCount(2) .withParamTypes(String.class, String.class).then().callParam().fromAttribute("key") .ofIndex(0).then().callParam().ofIndex(1); forPattern("server/servlet").createObject().ofType(ServletDefinition.class).then() .setNext("addServlet"); forPattern("server/servlet").setProperties(); forPattern("server/servlet/parameter").callMethod("addIniParam").withParamCount(2) .withParamTypes(String.class, String.class).then().callParam().fromAttribute("key") .ofIndex(0).then().callParam().ofIndex(1); } }); final Digester digester = loader.newDigester(); ret = (ServerDefinition) digester.parse(_url); } catch (final IOException e) { ServerDefinition.LOG.error(_url.toString() + " is not readable", e); } catch (final SAXException e) { ServerDefinition.LOG.error(_url.toString() + " seems to be invalide XML", e); } return ret; }
From source file:org.efaps.tests.ci.AbstractCIDataProvider.java
/** * Load ci./*from w ww . j a v a 2 s .com*/ * * @param _context the context */ @BeforeSuite public static void loadCI(final ITestContext _context) { final File xmlFile = new File(_context.getCurrentXmlTest().getSuite().getFileName()); final String baseFolderRel = _context.getCurrentXmlTest().getParameter("baseFolder"); final String baseFolder = FilenameUtils.concat(xmlFile.getPath(), baseFolderRel); AbstractCIDataProvider.LOG.debug("basefolder: '{}'", baseFolder); final Collection<File> files = FileUtils.listFiles(new File(baseFolder), new String[] { "xml" }, true); for (final File file : files) { AbstractCIDataProvider.LOG.debug("file added: '{}'", file); final DigesterLoader loader = DigesterLoader.newLoader(new FromAnnotationsRuleModule() { @Override protected void configureRules() { bindRulesFrom(CIForm.class); bindRulesFrom(CITable.class); bindRulesFrom(CICommand.class); bindRulesFrom(CISearch.class); bindRulesFrom(CIMenu.class); bindRulesFrom(CIType.class); bindRulesFrom(CIStatusGroup.class); bindRulesFrom(CINumberGenerator.class); bindRulesFrom(CIUIImage.class); bindRulesFrom(CIJasperImage.class); bindRulesFrom(CIAccessSet.class); bindRulesFrom(CISQLTable.class); bindRulesFrom(CIMsgPhrase.class); } }); try { final Digester digester = loader.newDigester(); final URLConnection connection = file.toURI().toURL().openConnection(); connection.setUseCaches(false); final InputStream stream = connection.getInputStream(); final InputSource source = new InputSource(stream); final Object item = digester.parse(source); stream.close(); if (item instanceof ICIItem) { ((ICIItem) item).setFile(file.getPath()); } if (item instanceof CIForm) { AbstractCIDataProvider.LOG.debug("Form added: '{}'", item); AbstractCIDataProvider.FORMS.add((CIForm) item); } else if (item instanceof CITable) { AbstractCIDataProvider.LOG.debug("Table added: '{}'", item); AbstractCIDataProvider.TABLES.add((CITable) item); } else if (item instanceof CICommand) { AbstractCIDataProvider.LOG.debug("Command added: '{}'", item); AbstractCIDataProvider.COMMANDS.add((CICommand) item); } else if (item instanceof CIType) { AbstractCIDataProvider.LOG.debug("Type added: '{}'", item); AbstractCIDataProvider.TYPES.add((CIType) item); } else if (item instanceof CIStatusGroup) { AbstractCIDataProvider.LOG.debug("CIStatusGroup added: '{}'", item); AbstractCIDataProvider.STATUSGRPS.add((CIStatusGroup) item); } else if (item instanceof CIMenu) { AbstractCIDataProvider.LOG.debug("CIMenu added: '{}'", item); AbstractCIDataProvider.MENUS.add((CIMenu) item); } else if (item instanceof CINumberGenerator) { AbstractCIDataProvider.LOG.debug("CINumberGenerator added: '{}'", item); AbstractCIDataProvider.NUMGENS.add((CINumberGenerator) item); } else if (item instanceof CIJasperImage) { AbstractCIDataProvider.LOG.debug("CINumberGenerator added: '{}'", item); AbstractCIDataProvider.JASPERIMG.add((CIJasperImage) item); } else if (item instanceof CIUIImage) { AbstractCIDataProvider.LOG.debug("CINumberGenerator added: '{}'", item); AbstractCIDataProvider.UIIMG.add((CIUIImage) item); } else if (item instanceof CIAccessSet) { AbstractCIDataProvider.LOG.debug("CIAccessSet added: '{}'", item); AbstractCIDataProvider.ACCESSSET.add((CIAccessSet) item); } else if (item instanceof CISearch) { AbstractCIDataProvider.LOG.debug("CISearch added: '{}'", item); AbstractCIDataProvider.SEARCHS.add((CISearch) item); } else if (item instanceof CISQLTable) { AbstractCIDataProvider.LOG.debug("CISearch added: '{}'", item); AbstractCIDataProvider.SQLTABLES.add((CISQLTable) item); } else if (item instanceof CIMsgPhrase) { AbstractCIDataProvider.LOG.debug("CIMsgPhrase added: '{}'", item); AbstractCIDataProvider.MSGPHRASES.add((CIMsgPhrase) item); } } catch (final MalformedURLException e) { AbstractCIDataProvider.LOG.error("MalformedURLException", e); } catch (final IOException e) { AbstractCIDataProvider.LOG.error("IOException", e); } catch (final SAXException e) { AbstractCIDataProvider.LOG.error("SAXException", e); } } final Collection<File> propFiles = FileUtils.listFiles(new File(baseFolder), new String[] { "properties" }, true); for (final File file : propFiles) { final Properties props = new Properties(); try { props.load(new FileInputStream(file)); AbstractCIDataProvider.LOG.debug("properties loaded: '{}'", file); } catch (final IOException e) { AbstractCIDataProvider.LOG.error("IOException", e); } AbstractCIDataProvider.DBPROPERTIES.putAll(props); } try { final InputStream ignStream = AbstractCIDataProvider.class.getResourceAsStream("/Ignore.properties"); if (ignStream != null) { final Properties ignoreProps = new Properties(); ignoreProps.load(ignStream); AbstractCIDataProvider.DBPROPERTIES.putAll(ignoreProps); } } catch (final IOException e) { AbstractCIDataProvider.LOG.error("IOException", e); } }
From source file:org.efaps.update.version.Application.java
/** * <code>null</code> is returned, of the version file could not be opened * and read./*from ww w . jav a 2s .c o m*/ * * @param _versionUrl URL of the version file which defines the application * @param _rootUrl root URL where the source files are located (for local * files); URL of the class file (if source is in a Jar file) * @param _classpathElements elements of the class path * @return application instance with all version information * @throws InstallationException if version XML file could not be parsed */ public static Application getApplication(final URL _versionUrl, final URL _rootUrl, final List<String> _classpathElements) throws InstallationException { Application appl = null; try { final DigesterLoader loader = DigesterLoader.newLoader(new FromAnnotationsRuleModule() { @Override protected void configureRules() { bindRulesFrom(Application.class); } }); final Digester digester = loader.newDigester(); appl = (Application) digester.parse(_versionUrl); appl.rootUrl = _rootUrl; appl.classpathElements = _classpathElements; for (final InstallFile installFile : appl.tmpElements) { appl.install.addFile(installFile.setURL(new URL(_rootUrl, installFile.getName()))); } appl.tmpElements = null; Collections.sort(appl.dependencies, new Comparator<Dependency>() { @Override public int compare(final Dependency _dependency0, final Dependency _dependency1) { return _dependency0.getOrder().compareTo(_dependency1.getOrder()); } }); for (final ApplicationVersion applVers : appl.getVersions()) { applVers.setApplication(appl); appl.setMaxVersion(applVers.getNumber()); } } catch (final IOException e) { if (e.getCause() instanceof InstallationException) { throw (InstallationException) e.getCause(); } else { throw new InstallationException("Could not open / read version file '" + _versionUrl + "'"); } //CHECKSTYLE:OFF } catch (final Exception e) { //CHECKSTYLE:ON throw new InstallationException("Error while parsing file '" + _versionUrl + "'", e); } return appl; }
From source file:org.esupportail.monitor.web.tools.Config.java
/** * Lit le fichier de configuration/*w ww. ja v a 2 s .com*/ */ private void parseConfigFile() { Digester dig = new Digester(); dig.push(this); dig.addCallMethod("config/server", "addServer", 2); dig.addCallParam("config/server", 0, "name"); dig.addCallParam("config/server", 1, "url"); URL resourceURL = Config.class.getResource(configFile); if (resourceURL != null) { try { // On parse le fichier dont le chemin est pass en paramtre dig.parse(new InputSource(resourceURL.toExternalForm())); } catch (IOException e) { logger.error("Config::parseConfig() : Impossible d'ouvrir le fichier de config \n" + e); } catch (SAXException e) { logger.error("Config::parseConfig() : SAXException :\n" + e); } catch (Exception e) { logger.error("Config::parseConfig() : Exception :\n" + e); } } else { logger.error("Config::parseConfig() : Le fichier de configuration est introuvable"); } }
From source file:org.esupportail.monitor.web.tools.InfosCollector.java
/** * Rcupre les informations d'un serveur distant * @param s L'objet remplit//from www . j a v a 2 s. c o m * @return status vrai si tout se passe bien, faux sinon */ public static boolean fetch(ServerInfo s, boolean users) { Digester dig = new Digester(); dig.push(s); dig.addObjectCreate("runtimeinfo/memory", MemoryInfo.class); dig.addSetProperties("runtimeinfo/memory"); dig.addSetNext("runtimeinfo/memory", "setMemory"); dig.addObjectCreate("runtimeinfo/sessions", SessionInfo.class); dig.addSetProperties("runtimeinfo/sessions"); dig.addSetNext("runtimeinfo/sessions", "setSession"); dig.addCallMethod("runtimeinfo/users/user", "addUser", 1); dig.addCallParam("runtimeinfo/users/user", 0, "uid"); URL ressourceUrl = null; try { if (users) { ressourceUrl = new URL(s.getUrl() + "?xml=full"); } else { ressourceUrl = new URL(s.getUrl() + "?xml"); } } catch (MalformedURLException e) { // logger.error(e); System.out.print(e + "\n"); return false; } if (ressourceUrl != null) { try { // On parse le fichier dont le chemin est pass en paramtre dig.parse(new InputSource(ressourceUrl.toExternalForm())); } catch (IOException e) { //logger.error("InfosCollector::fetch() : Impossible d'ouvrir l'URL \n" + e); System.out.print("InfosCollector::fetch() : Impossible d'ouvrir l'URL \n" + e); return false; } catch (SAXException e) { //logger.error("InfosCollector::fetch() : SAXException :\n" + e); System.out.print("InfosCollector::fetch() : SAXException :\n" + e); return false; } catch (Exception e) { //logger.error("InfosCollector::fetch() : Exception :\n" + e); System.out.print("InfosCollector::fetch() : Exception :\n" + e); return false; } } else { //logger.error("InfosCollector::fetch() : L'URL est introuvable"); System.out.print("InfosCollector::fetch() : L'URL est introuvable"); return false; } return true; }
From source file:org.gbif.metadata.eml.EmlFactory.java
/** * Uses rule based parsing to read the EML XML and build the EML model. * Note the following: - Metadata provider rules are omitted on the assumption that the provider is the same as the * creator - Contact rules are omitted on the assumption that contacts are covered by the creator and associated * parties - Publisher rules are omitted on the assumption the publisher is covered by the creator and associated * parties/*w w w. j a v a2s . com*/ * * @param xml To read. Note this will be closed before returning * * @return The EML populated * * @throws IOException If the Stream cannot be read from * @throws SAXException If the XML is not well formed */ public static Eml build(InputStream xml) throws IOException, SAXException, ParserConfigurationException { Digester digester = new Digester(); digester.setNamespaceAware(true); // push the EML object onto the stack Eml eml = new Eml(); digester.push(eml); // add the rules // language as xml:lang attribute digester.addCallMethod("eml", "setMetadataLanguage", 1); digester.addCallParam("eml", 0, "xml:lang"); // guid as packageId attribute digester.addCallMethod("eml", "setPackageId", 1); digester.addCallParam("eml", 0, "packageId"); // alternative ids digester.addCallMethod("eml/dataset/alternateIdentifier", "addAlternateIdentifier", 1); digester.addCallParam("eml/dataset/alternateIdentifier", 0); // title together with language digester.addCallMethod("eml/dataset/title", "setTitle", 2); digester.addCallParam("eml/dataset/title", 0); digester.addCallParam("eml/dataset/title", 1, "xml:lang"); digester.addBeanPropertySetter("eml/dataset/language", "language"); // descriptions, broken into multiple paragraphs digester.addCallMethod("eml/dataset/abstract/para", "addDescriptionPara", 1); digester.addCallParam("eml/dataset/abstract/para", 0); digester.addBeanPropertySetter("eml/dataset/additionalInfo/para", "additionalInfo"); digester.addRule("eml/dataset/intellectualRights/para", new NodeCreateRule(Node.ELEMENT_NODE)); digester.addSetNext("eml/dataset/intellectualRights/para", "parseIntellectualRights"); digester.addCallMethod("eml/dataset/methods/methodStep/description/para", "addMethodStep", 1); digester.addCallParam("eml/dataset/methods/methodStep/description/para", 0); digester.addBeanPropertySetter("eml/dataset/methods/sampling/studyExtent/description/para", "studyExtent"); digester.addBeanPropertySetter("eml/dataset/methods/sampling/samplingDescription/para", "sampleDescription"); digester.addBeanPropertySetter("eml/dataset/methods/qualityControl/description/para", "qualityControl"); digester.addBeanPropertySetter("eml/dataset/distribution/online/url", "distributionUrl"); digester.addBeanPropertySetter("eml/dataset/purpose/para", "purpose"); digester.addBeanPropertySetter("eml/dataset/maintenance/description/para", "updateFrequencyDescription"); digester.addCallMethod("eml/dataset/maintenance/maintenanceUpdateFrequency", "setUpdateFrequency", 1); digester.addCallParam("eml/dataset/maintenance/maintenanceUpdateFrequency", 0); digester.addCallMethod("eml/additionalMetadata/metadata/gbif/citation", "setCitation", 2); digester.addCallParam("eml/additionalMetadata/metadata/gbif/citation", 0); digester.addCallParam("eml/additionalMetadata/metadata/gbif/citation", 1, "identifier"); digester.addCallMethod("eml/additionalMetadata/metadata/gbif/specimenPreservationMethod", "addSpecimenPreservationMethod", 1); digester.addCallParam("eml/additionalMetadata/metadata/gbif/specimenPreservationMethod", 0); digester.addBeanPropertySetter("eml/additionalMetadata/metadata/gbif/resourceLogoUrl", "logoUrl"); digester.addBeanPropertySetter("eml/additionalMetadata/metadata/gbif/hierarchyLevel", "hierarchyLevel"); digester.addCallMethod("eml/dataset/pubDate", "setPubDateAsString", 1); digester.addCallParam("eml/dataset/pubDate", 0); digester.addCallMethod("eml/additionalMetadata/metadata/gbif/dateStamp", "setDateStamp", 1); digester.addCallParam("eml/additionalMetadata/metadata/gbif/dateStamp", 0); addAgentRules(digester, "eml/dataset/creator", "addCreator"); addAgentRules(digester, "eml/dataset/metadataProvider", "addMetadataProvider"); addAgentRules(digester, "eml/dataset/contact", "addContact"); addAgentRules(digester, "eml/dataset/associatedParty", "addAssociatedParty"); addKeywordRules(digester); addBibliographicCitations(digester); addGeographicCoverageRules(digester); addTemporalCoverageRules(digester); addLivingTimePeriodRules(digester); addFormationPeriodRules(digester); addTaxonomicCoverageRules(digester); addProjectRules(digester); addCollectionRules(digester); addPhysicalDataRules(digester); addJGTICuratorialIUnit(digester); // now parse and return the EML try { digester.parse(xml); } finally { xml.close(); } return eml; }
From source file:org.gbif.registry.metasync.protocols.BaseProtocolHandler.java
/** * Makes a HTTP request to the provided {@link URI} and uses the {@link Digester} to parse the response. * /* ww w. j a va 2s. c o m*/ * @param uri to issue request against * @param digester to parse response with * @param <T> type of Object to return * @throws MetadataException in case anything goes wrong during the request, all underlying HTTP errors are mapped to * the appropriate {@link ErrorCode}s. */ protected <T> T doHttpRequest(URI uri, Digester digester) throws MetadataException { HttpUriRequest get = new HttpGet(uri); HttpResponse response; try { // Not using a Response Handler here because that can't throw arbitrary Exceptions response = httpClient.execute(get); } catch (ClientProtocolException e) { throw new MetadataException(e, ErrorCode.HTTP_ERROR); } catch (IOException e) { throw new MetadataException(e, ErrorCode.IO_EXCEPTION); } // Everything but HTTP status 200 is an error if (response.getStatusLine().getStatusCode() != 200) { LOG.debug("Received HTTP code[{}] cause[{}] for request: {}", response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase(), uri); String cause = String.format("Received HTTP code[%d], phrase[%s]", response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase()); throw new MetadataException(cause, ErrorCode.HTTP_ERROR); } try { return digester.parse(response.getEntity().getContent()); } catch (SAXException e) { throw new MetadataException(e, ErrorCode.PROTOCOL_ERROR); } catch (IOException e) { throw new MetadataException(e, ErrorCode.IO_EXCEPTION); } finally { try { EntityUtils.consume(response.getEntity()); } catch (IOException e2) { LOG.warn("Error consuming content after an exception", e2); } } }
From source file:org.mongeez.reader.FilesetXMLReader.java
public List<Resource> getFiles(Resource file) { List<Resource> files = new ArrayList<Resource>(); try {/* ww w. jav a2s .c o m*/ Digester digester = new Digester(); digester.setValidating(false); digester.addObjectCreate("changeFiles", ChangeFileSet.class); digester.addObjectCreate("changeFiles/file", ChangeFile.class); digester.addSetProperties("changeFiles/file"); digester.addSetNext("changeFiles/file", "add"); logger.info("Parsing XML Fileset file {}", file.getFilename()); ChangeFileSet changeFileSet = (ChangeFileSet) digester.parse(file.getInputStream()); if (changeFileSet != null) { logger.info("Num of changefiles found " + changeFileSet.getChangeFiles().size()); for (ChangeFile changeFile : changeFileSet.getChangeFiles()) { files.add(file.createRelative(changeFile.getPath())); } } else { logger.error("The file {} doesn't seem to contain a changeFiles declaration. Are you " + "using the correct file to initialize Mongeez?", file.getFilename()); } } catch (IOException e) { logger.error("IOException", e); } catch (org.xml.sax.SAXException e) { logger.error("SAXException", e); } return files; }