package com.blackducksoftware.integration.hub.detect.workflow.search;

import java.io.File;
import java.util.List;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.WildcardFileFilter;

public class DetectorExclusionSearchFilter implements DetectorSearchFilter {
    private List<String> excludedDirectories;
    private WildcardFileFilter fileFilter;

    public DetectorExclusionSearchFilter(List<String> excludedDirectories, List<String> excludedDirectoryNamePatterns){
        this.excludedDirectories = excludedDirectories;
        fileFilter = new WildcardFileFilter(excludedDirectoryNamePatterns);
    }

    @Override
    public boolean shouldExclude(File file) {
        for (final String excludedDirectory : excludedDirectories) {
            if (FilenameUtils.wildcardMatchOnSystem(file.getName(), excludedDirectory)) {
                return true;
            }
        }

        if (fileFilter.accept(file)){
            return false; //it was accepted, do NOT exclude
        } else {
            return true; //it was not accepted, exclude
        }
    }
}

@@ -946,20 +946,23 @@
         
-if (
+return 
 fileFilt
@@ -980,157 +980,63 @@
 ile)
-)%7B%0D%0A            return false; //it was accepted, do NOT exclude%0D%0A        %7D else %7B%0D%0A            return true; //it was not accepted, exclude%0D%0A        %7D
+; //returns TRUE if it matches one of the file filters.
 %0D%0A  

Update DetectorExclusionSearchFilter.java