private List < File > getConfigFiles ( File dir ) { String [ ] extensions = { "xml" } ; List < File > configFiles = new ArrayList < File > ( ) ; Collection < File > files = FileUtils . listFiles ( dir , extensions , true ) ; for ( Iterator < File > iterator = files . iterator ( ) ; iterator . hasNext ( ) ; ) { File file = ( File ) iterator . next ( ) ; if ( file . getName ( ) . equals ( "config.xml" ) ) { configFiles . add ( file ) ; } } return configFiles ; }
Returns the all config file found under a directory