public static boolean configure ( File configFile ) { boolean goOn = true ; if ( ! configFile . exists ( ) ) { LogHelperDebug . printError ( "File " + configFile . getAbsolutePath ( ) + " does not exist" , false ) ; goOn = false ; } DocumentBuilderFactory documentBuilderFactory = null ; DocumentBuilder documentBuilder = null ; if ( goOn ) { documentBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; try { documentBuilder = documentBuilderFactory . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException ex ) { LogHelperDebug . printError ( ex . getMessage ( ) , ex , false ) ; goOn = false ; } } Document configDocument = null ; if ( goOn ) { try { configDocument = documentBuilder . parse ( configFile ) ; } catch ( SAXException ex ) { LogHelperDebug . printError ( ex . getMessage ( ) , ex , false ) ; goOn = false ; } catch ( IOException ex ) { LogHelperDebug . printError ( ex . getMessage ( ) , ex , false ) ; goOn = false ; } } NodeList configNodeList = null ; if ( goOn ) { configNodeList = configDocument . getElementsByTagName ( "log-helper" ) ; if ( configNodeList == null ) { LogHelperDebug . printError ( "configNodeList is null" , false ) ; goOn = false ; } else if ( configNodeList . getLength ( ) < 1 ) { LogHelperDebug . printError ( "configNodeList is empty" , false ) ; goOn = false ; } } Node configNode = null ; if ( goOn ) { configNode = configNodeList . item ( 0 ) ; if ( configNode == null ) { LogHelperDebug . printError ( "configNode is null" , false ) ; goOn = false ; } } boolean success = false ; if ( goOn ) { success = configure ( configNode ) ; } return success ; }
Configure the log - helper library to the values in the given XML config file