public class FileExtensionSelector extends Object implements FileSelector
FileSelector
that selects based on file extensions.
The extension comparison is case insensitive.
The selector makes a copy of a given Collection or array. Changing the object passed in the constructors will not affect the selector.
Constructor and Description |
---|
FileExtensionSelector(Collection<String> extensions)
Creates a new selector for the given extensions.
|
FileExtensionSelector(String... extensions)
Creates a new selector for the given extensions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
includeFile(FileSelectInfo fileInfo)
Determines if a file or folder should be selected.
|
boolean |
traverseDescendents(FileSelectInfo fileInfo)
Determines whether a folder should be traversed.
|
public FileExtensionSelector(Collection<String> extensions)
extensions
- The extensions to be included by this selector.public FileExtensionSelector(String... extensions)
extensions
- The extensions to be included by this selector.public boolean includeFile(FileSelectInfo fileInfo) throws Exception
includeFile
in interface FileSelector
fileInfo
- The file selection information.Exception
- if an error occurs.public boolean traverseDescendents(FileSelectInfo fileInfo) throws Exception
traverseDescendents
in interface FileSelector
fileInfo
- The file selection information.Exception
- if an error occurs.Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.