private void setXMLProperties(InputStream xmlConfigFile, String sectionName)
			throws Exception {
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		DocumentBuilder db;
		// ugly XML parsing, but this is built-in the JDK.
		try {
			db = dbf.newDocumentBuilder();
			Document doc = db.parse(xmlConfigFile);
			doc.getDocumentElement().normalize();

			// get the default settings
			Properties settings = parseXML(doc, null);
			if (sectionName != null){
				// override with custom settings
				settings.putAll(parseXML(doc, sectionName));
			}
			// set the properties
			setProperties(settings);

		} catch (Exception e) {
			throw e;
		} finally {
			if (xmlConfigFile != null){ // safety
				xmlConfigFile.close();
			}
		}
	}
private void setXMLProperties ( InputStream xmlConfigFile , String sectionName ) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder db ; try { db = dbf . newDocumentBuilder ( ) ; Document doc = db . parse ( xmlConfigFile ) ; doc . getDocumentElement ( ) . normalize ( ) ; Properties settings = parseXML ( doc , null ) ; if ( sectionName != null ) { settings . putAll ( parseXML ( doc , sectionName ) ) ; } setProperties ( settings ) ; } catch ( Exception e ) { throw e ; } finally { if ( xmlConfigFile != null ) { xmlConfigFile . close ( ) ; } } }
@param xmlConfigFile
@param sectionName
@throws Exception