question: private static String [ ] scanForSources ( final File sourceDir , final Set < String > sourceIncludes , final Set < String > sourceExcludes ) { final DirectoryScanner ds = new DirectoryScanner ( ) ; ds . setFollowSymlinks ( true ) ; ds . setBasedir ( sourceDir ) ; ds . setIncludes ( sourceIncludes . toArray ( new String [ sourceIncludes . size ( ) ] ) ) ; ds . setExcludes ( sourceExcludes . toArray ( new String [ sourceExcludes . size ( ) ] ) ) ; ds . addDefaultExcludes ( ) ; try { ds . scan ( ) ; } catch ( IllegalStateException e ) { return new String [ 0 ] ; } return ds . getIncludedFiles ( ) ; }
target:  Scans a single source dir for sources and includes only the files whose name match the patterns in sourceIncludes and excludes all files whose names match the patterns in sourceExcludes