public static enum ContentExtensionFileFilter.TestStrategy extends java.lang.Enum<ContentExtensionFileFilter.TestStrategy>
ContentExtensionFileFilter
determine which files are valid.Enum Constant and Description |
---|
BOTH
Files will first be selected by their extension and those will additionally be tested by their content.
|
CONTENT
Files will only be tested by their content.
|
EXTENSION
Files will only be filtered by their extension.
|
Modifier and Type | Method and Description |
---|---|
static ContentExtensionFileFilter.TestStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ContentExtensionFileFilter.TestStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ContentExtensionFileFilter.TestStrategy EXTENSION
This option does not allow to distinguish between different file types, that may have the same extension, but is a lot faster then the alternatives, since files do not have to be opened. This is especially true of folder with many files or folder on slow (network) resources shall be tested.
public static final ContentExtensionFileFilter.TestStrategy CONTENT
This option allow to distinguish file types by the file content and does not require them to have unique extensions. Note that this option can be slow if many files are contained in a folder or a folder is located on a slow resource, since each file needs to be opened.
public static final ContentExtensionFileFilter.TestStrategy BOTH
This option is a compromise between the other two. It is faster than CONTENT
since only files with
a respective extension need to be opened and still allows to determine between file types, that may share an
extension. It should always be preferred over CONTENT
if files can be expected to have one of the defined
extensions.
public static ContentExtensionFileFilter.TestStrategy[] values()
for (ContentExtensionFileFilter.TestStrategy c : ContentExtensionFileFilter.TestStrategy.values()) System.out.println(c);
public static ContentExtensionFileFilter.TestStrategy valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null