Package com.day.util
Class FileExpander
- java.lang.Object
-
- com.day.util.FileExpander
-
- All Implemented Interfaces:
HandleExpander
public class FileExpander extends java.lang.Object implements HandleExpander
TheFileExpander
takes file names as input, expands them according to the globbing patterns and returns a list of file names.- Since:
- coati Audience wad
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileExpander.BaseFilter
TheBaseFilter
class is an abstract base class for the file and directory matcher class, which accepts files based on globbing patterns.
-
Field Summary
Fields Modifier and Type Field Description static FileExpander.BaseFilter
RETURN_ALL
static FileExpander.BaseFilter
RETURN_DIRECTORIES
static FileExpander.BaseFilter
RETURN_FILES
-
Constructor Summary
Constructors Constructor Description FileExpander()
FileExpander(java.io.File root, FileExpander.BaseFilter type)
FileExpander(java.lang.String root, FileExpander.BaseFilter type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
expand(java.lang.String pattern)
Expands the file name pattern returning a list of file names matching to that pattern.
-
-
-
Field Detail
-
RETURN_ALL
public static final FileExpander.BaseFilter RETURN_ALL
-
RETURN_FILES
public static final FileExpander.BaseFilter RETURN_FILES
-
RETURN_DIRECTORIES
public static final FileExpander.BaseFilter RETURN_DIRECTORIES
-
-
Constructor Detail
-
FileExpander
public FileExpander()
-
FileExpander
public FileExpander(java.lang.String root, FileExpander.BaseFilter type)
-
FileExpander
public FileExpander(java.io.File root, FileExpander.BaseFilter type)
-
-
Method Detail
-
expand
public java.lang.String[] expand(java.lang.String pattern)
Expands the file name pattern returning a list of file names matching to that pattern. This list will only contain names of real files regardless of whether a directory's name would match the pattern or not.- Specified by:
expand
in interfaceHandleExpander
- Parameters:
pattern
- the pattern to match.- Returns:
- A list of filenames matching the pattern
- See Also:
for a description of the pattern format.
-
-