# Class: com.pnfsoftware.jeb.util.io.DirectoryEnumerator

List \(full in\-memory enumeration\) or iterate over a directory contents, with support for recursion and regex file filters. The returned File Objects are real [File](File)s passing the `File.isFile()` test.

## Constructor: DirectoryEnumerator
- parameter: `base`, type: `java.io.File`
- parameter: `filterString`, type: `java.lang.String`
- parameter: `recurse`, type: `boolean`

Description: Create a new directory enumerator.
parameter: base: base folder
parameter: filterString: optional wildcard filter string for filenames; to use a full regex            pattern, provide null for this parameter and use [#setFilter(Pattern)](#setFilter(Pattern)) after            construction
parameter: recurse: true to recursively enumerate sub\-directories.
throws: on initialization error

## Constructor: DirectoryEnumerator
- parameter: `base`, type: `java.io.File`

Description: Create a new directory enumerator. The enumerator is filter\-less \(it matches on all files\) and does not recurse over sub\-directories.
parameter: base: 

## Method: addBlackListedDirectory
- parameter: `dirname`, type: `java.lang.String`

Description: Record a simple directory name \(not path\) that should not be recursively explored. Ignored if the enumerator is not recursive. The base directory is always explored, even if its simple name is blacklisted. 

 Example: 'xyz' is blacklisted, the search is recursive and starts in '/xyz':
 \- "/xyz/..." is explored, no matter what
 \- if it exists, "/xyz/xyz/..." and its sub\-dirs WONT be explored
 \- if it exists, "/xyz/0/1/xyz/..." and its sub\-dirs WONT be explored
 \- if it exists, file named '/xyz/xyz' or /xyz/foo/xyz" WILL be returned.
parameter: dirname: 

## Method: getBlacklistedDirnames
- return type: `java.util.Collection<java.lang.String>`

Description: 
return: 

## Method: getFilter
- return type: `java.util.regex.Pattern`

Description: 
return: 

## Method: isRecurse
- return type: `boolean`

Description: 
return: 

## Method: iterator
- return type: `java.util.Iterator<java.io.File>`


## Method: list
- return type: `java.util.List<java.io.File>`

Description: Browse the folder\(s\) and retrieve the matching files.
return: a list of files

## Method: setFilter
- parameter: `pattern`, type: `java.util.regex.Pattern`

Description: Set a regex pattern to select files. 

 Example: `".*\\.(exe|dll)$"` will match all Windows executables and dynamic libraries.
parameter: pattern: optional regex pattern, null to disable

## Method: setFilterString
- parameter: `filterString`, type: `java.lang.String`
- parameter: `matchCaseInsensitive`, type: `boolean`
- parameter: `matchUnicode`, type: `boolean`

Description: 
parameter: filterString: non\-null filter string; to disable filters, use            [#setFilter(Pattern)](#setFilter(Pattern))
parameter: matchCaseInsensitive: 
parameter: matchUnicode: 

## Method: setRecurse
- parameter: `recurse`, type: `boolean`

Description: 
parameter: recurse: 

