/** * Build a configuration object from a file using a File object. * @param file a <code>File</code> object * @return a <code>Configuration</code> object * @throws SAXException if a parsing error occurs * @throws IOException if an I/O error occurs * @throws ConfigurationException if an error occurs */ public Configuration buildFromFile( final File file ) throws SAXException, IOException, ConfigurationException { synchronized( this ) { m_handler.clear(); m_parser.parse( file.toURL().toString() ); return m_handler.getConfiguration(); } }
/** * Build a configuration object using an XML InputSource object * @param input an <code>InputSource</code> value * @return a <code>Configuration</code> object * @throws SAXException if a parsing error occurs * @throws IOException if an I/O error occurs * @throws ConfigurationException if an error occurs */ public Configuration build( final InputSource input ) throws SAXException, IOException, ConfigurationException { synchronized( this ) { m_handler.clear(); m_parser.parse( input ); return m_handler.getConfiguration(); } }
/** * */ private Configuration readRefreshJobConfiguration() { Source source = null; SAXConfigurationHandler b = new SAXConfigurationHandler(); try { if (this.configFile.exists()) { source = this.resolver.resolveURI(this.configFile.toURL().toString()); SourceUtil.toSAX(this.manager, source, source.getMimeType(), b); } } catch (Exception ignore) { getLogger().warn("Unable to read configuration from " + this.configFile); } finally { if (source != null) { this.resolver.release(source); } } return b.getConfiguration(); }
conf.configuration = builder.getConfiguration();
conf.configuration = builder.getConfiguration();
SAXConfigurationHandler handler = new SAXConfigurationHandler(); SourceUtil.toSAX(this.manager, src, null, handler); config = handler.getConfiguration(); } finally { resolver.release(src);