public FileFilter build ( ) { if ( filenames . isEmpty ( ) && extensions . isEmpty ( ) && fileFilters . isEmpty ( ) ) { throw new IllegalStateException ( "May only be invoked after at least one add... method has been invoked." ) ; } final OrFileFilter filter = new OrFileFilter ( ) ; if ( ! filenames . isEmpty ( ) ) { filter . addFileFilter ( new NameFileFilter ( new ArrayList <> ( filenames ) ) ) ; } if ( ! extensions . isEmpty ( ) ) { filter . addFileFilter ( new SuffixFileFilter ( new ArrayList <> ( extensions ) , IOCase . INSENSITIVE ) ) ; } for ( IOFileFilter iof : fileFilters ) { filter . addFileFilter ( iof ) ; } return filter ; }
Builds the filter and returns it .