protected String [ ] getFileNames ( File pDir , String [ ] pIncludes , String [ ] pExcludes ) throws MojoFailureException , MojoExecutionException { if ( pDir == null ) { throw new MojoFailureException ( "A ValidationSet or TransformationSet" + " requires a nonempty 'dir' child element." ) ; } final File dir = asAbsoluteFile ( pDir ) ; if ( ! dir . isDirectory ( ) ) { throw new MojoExecutionException ( "The directory " + dir . getPath ( ) + ", which is a base directory of a ValidationSet or TransformationSet, does not exist." ) ; } final DirectoryScanner ds = new DirectoryScanner ( ) ; ds . setBasedir ( dir ) ; if ( pIncludes != null && pIncludes . length > 0 ) { ds . setIncludes ( pIncludes ) ; } if ( pExcludes != null && pExcludes . length > 0 ) { ds . setExcludes ( pExcludes ) ; } ds . scan ( ) ; return ds . getIncludedFiles ( ) ; }
Scans a directory for files and returns a set of path names .