public static enum ContentExtensionFileFilter.TestStrategy extends java.lang.Enum<ContentExtensionFileFilter.TestStrategy>
ContentExtensionFileFilterdetermine which files are valid.
|Enum Constant and Description|
Files will first be selected by their extension and those will additionally be tested by their content.
Files will only be tested by their content.
Files will only be filtered by their extension.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
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
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 name
java.lang.NullPointerException- if the argument is null