private Set < String > getConfigDropinsFeatures ( Set < String > origResult , File serverDirectory , String folderName ) { Set < String > result = origResult ; File configDropinsFolder ; try { configDropinsFolder = new File ( new File ( serverDirectory , "configDropins" ) , folderName ) . getCanonicalFile ( ) ; } catch ( IOException e ) { // skip this directory if its path cannot be queried warn ( "The " + serverDirectory + "/configDropins/" + folderName + " directory cannot be accessed. Skipping its server features." ) ; debug ( e ) ; return result ; } File [ ] configDropinsXmls = configDropinsFolder . listFiles ( new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { return name . endsWith ( ".xml" ) ; } } ) ; if ( configDropinsXmls == null || configDropinsXmls . length == 0 ) { return result ; } // sort the files in alphabetical order so that overrides will happen in the proper order Comparator < File > comparator = new Comparator < File > ( ) { @ Override public int compare ( File left , File right ) { return left . getAbsolutePath ( ) . toLowerCase ( ) . compareTo ( right . getAbsolutePath ( ) . toLowerCase ( ) ) ; } } ; Collections . sort ( Arrays . asList ( configDropinsXmls ) , comparator ) ; for ( File xml : configDropinsXmls ) { Set < String > features = getServerXmlFeatures ( result , xml , null ) ; if ( features != null ) { result = features ; } } return result ; }
Gets features from the configDropins s defaults or overrides directory