private void parseDirectoryFiles ( WsResource directory , ServerConfiguration configuration ) throws ConfigParserException , ConfigValidationException { if ( directory != null ) { File [ ] defaultFiles = getChildXMLFiles ( directory ) ; if ( defaultFiles == null ) return ; Arrays . sort ( defaultFiles , new AlphaComparator ( ) ) ; for ( int i = 0 ; i < defaultFiles . length ; i ++ ) { File file = defaultFiles [ i ] ; if ( ! file . isFile ( ) ) continue ; WsResource defaultFile = directory . resolveRelative ( file . getName ( ) ) ; if ( defaultFile == null ) { // This should never happen, but it's conceivable that someone could remove a file // after listFiles and before getChild if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , file . getName ( ) + " was not found in directory " + directory . getName ( ) + ". Ignoring. " ) ; } continue ; } Tr . audit ( tc , "audit.dropin.being.processed" , defaultFile . asFile ( ) ) ; try { parser . parseServerConfiguration ( defaultFile , configuration ) ; } catch ( ConfigParserException ex ) { parser . handleParseError ( ex , null ) ; if ( ErrorHandler . INSTANCE . fail ( ) ) { // if onError=FAIL, bubble the exception up the stack throw ex ; } else { // Mark the last update for the configuration so that we don't try to load it again configuration . updateLastModified ( configRoot . getLastModified ( ) ) ; } } } } }
Parse all of the config files in a directory in platform insensitive alphabetical order