|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.interview.ExtensionFileFilter
public class ExtensionFileFilter
A filter which accepts files based on their extension.
Constructor Summary | |
---|---|
ExtensionFileFilter(java.lang.String[] extns,
java.lang.String description)
Create a filter which accepts files based on their extension. |
|
ExtensionFileFilter(java.lang.String extn,
java.lang.String description)
Create a filter which accepts files based on their extension. |
Method Summary | |
---|---|
boolean |
accept(java.io.File f)
Check if a file is accepted by this filter. |
boolean |
acceptsDirectories()
Check if (all) directories are accepted by this filter. |
java.io.File |
ensureExtension(java.io.File file)
Ensure that a filename ends with one of the extensions accepted by this filter. |
java.lang.String |
ensureExtension(java.lang.String path)
Ensure that a pathname ends with one of the extensions accepted by this filter. |
java.lang.String |
getDescription()
Get a short description for this filter. |
boolean |
isCaseSensitive()
Check whether or not this filter should perform case-sensitive matching for extensions. |
void |
setCaseSensitive(boolean b)
Specify whether or not this filter should perform case-sensitive matching for extensions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensionFileFilter(java.lang.String extn, java.lang.String description)
extn
- The required extension for files that are to be
accepted by this filter.description
- A short string describing the filter.public ExtensionFileFilter(java.lang.String[] extns, java.lang.String description)
extns
- Any array of permissible extensions for
files that are to be accepted by this filter.description
- A short string describing the filter.Method Detail |
---|
public void setCaseSensitive(boolean b)
b
- true if this filter should perform case-sensitive matching for
extensions, and false otherwiseisCaseSensitive()
public boolean isCaseSensitive()
setCaseSensitive(boolean)
public boolean accept(java.io.File f)
FileFilter
accept
in interface FileFilter
f
- The file to be tested.
public boolean acceptsDirectories()
FileFilter
acceptsDirectories
in interface FileFilter
public java.lang.String getDescription()
getDescription
in interface FileFilter
public java.lang.String ensureExtension(java.lang.String path)
path
- The path to be checked.
public java.io.File ensureExtension(java.io.File file)
file
- The file to be checked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |