@SuppressWarnings("CheckStyle")
    public static List<File> filterFiles(final File baseDir,
                                         final List<String> sources,
                                         final String standardDirectory,
                                         final Log log,
                                         final String fileTypeDescription,
                                         final List<Filter<File>> excludeFilters) {

        // Check sanity
        Validate.notNull(baseDir, "baseDir");
        Validate.notNull(log, "log");
        Validate.notEmpty(standardDirectory, "standardDirectory");
        Validate.notEmpty(fileTypeDescription, "fileTypeDescription");

        // No sources provided? Fallback to the standard (which should be a relative path).
        List<String> effectiveSources = sources;
        if (sources == null || sources.isEmpty()) {
            effectiveSources = new ArrayList<String>();

            final File tmp = new File(standardDirectory);
            final File rootDirectory = tmp.isAbsolute() ? tmp : new File(baseDir, standardDirectory);
            effectiveSources.add(FileSystemUtilities.getCanonicalPath(rootDirectory));
        }

        // First, remove the non-existent sources.
        List<File> existingSources = new ArrayList<File>();
        for (String current : effectiveSources) {

            final File existingFile = FileSystemUtilities.getExistingFile(current, baseDir);
            if (existingFile != null) {
                existingSources.add(existingFile);

                if (log.isDebugEnabled()) {
                    log.debug("Accepted configured " + fileTypeDescription + " ["
                            + FileSystemUtilities.getCanonicalFile(existingFile) + "]");
                }
            } else {
                if (log.isInfoEnabled()) {
                    log.info("Ignored given or default " + fileTypeDescription + " [" + current
                            + "], since it is not an existent file or directory.");
                }
            }
        }

        if (log.isDebugEnabled() && existingSources.size() > 0) {

            final int size = existingSources.size();

            log.debug(" [" + size + " existing " + fileTypeDescription + "] ...");
            for (int i = 0; i < size; i++) {
                log.debug("   " + (i + 1) + "/" + size + ": " + existingSources.get(i));
            }
            log.debug(" ... End [" + size + " existing " + fileTypeDescription + "]");
        }

        // All Done.
        return FileSystemUtilities.resolveRecursively(existingSources, excludeFilters, log);
    }
@ SuppressWarnings ( "CheckStyle" ) public static List < File > filterFiles ( final File baseDir , final List < String > sources , final String standardDirectory , final Log log , final String fileTypeDescription , final List < Filter < File > > excludeFilters ) { Validate . notNull ( baseDir , "baseDir" ) ; Validate . notNull ( log , "log" ) ; Validate . notEmpty ( standardDirectory , "standardDirectory" ) ; Validate . notEmpty ( fileTypeDescription , "fileTypeDescription" ) ; List < String > effectiveSources = sources ; if ( sources == null || sources . isEmpty ( ) ) { effectiveSources = new ArrayList < String > ( ) ; final File tmp = new File ( standardDirectory ) ; final File rootDirectory = tmp . isAbsolute ( ) ? tmp : new File ( baseDir , standardDirectory ) ; effectiveSources . add ( FileSystemUtilities . getCanonicalPath ( rootDirectory ) ) ; } List < File > existingSources = new ArrayList < File > ( ) ; for ( String current : effectiveSources ) { final File existingFile = FileSystemUtilities . getExistingFile ( current , baseDir ) ; if ( existingFile != null ) { existingSources . add ( existingFile ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Accepted configured " + fileTypeDescription + " [" + FileSystemUtilities . getCanonicalFile ( existingFile ) + "]" ) ; } } else { if ( log . isInfoEnabled ( ) ) { log . info ( "Ignored given or default " + fileTypeDescription + " [" + current + "], since it is not an existent file or directory." ) ; } } } if ( log . isDebugEnabled ( ) && existingSources . size ( ) > 0 ) { final int size = existingSources . size ( ) ; log . debug ( " [" + size + " existing " + fileTypeDescription + "] ..." ) ; for ( int i = 0 ; i < size ; i ++ ) { log . debug ( "   " + ( i + 1 ) + "/" + size + ": " + existingSources . get ( i ) ) ; } log . debug ( " ... End [" + size + " existing " + fileTypeDescription + "]" ) ; } return FileSystemUtilities . resolveRecursively ( existingSources , excludeFilters , log ) ; }
Filters files found either in the sources paths (or in the standardDirectory if no explicit sources are given),
and retrieves a List holding those files that do not match any of the supplied Java Regular Expression
excludePatterns.

@param baseDir             The non-null basedir Directory.
@param sources             The sources which should be either absolute or relative (to the given baseDir)
paths to files or to directories that should be searched recursively for files.
@param standardDirectory   If no sources are given, revert to searching all files under this standard directory.
This is the path appended to the baseDir to reach a directory.
@param log                 A non-null Maven Log for logging any operations performed.
@param fileTypeDescription A human-readable short description of what kind of files are searched for, such as
"xsdSources" or "xjbSources".
@param excludeFilters      An optional List of Filters used to identify files which should be excluded from
the result.
@return All files under the supplied sources (or standardDirectory, if no explicit sources are given) which
do not match the supplied Java Regular excludePatterns.