|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.sadun.util.ExtensionFileFilter
A simple FileFilter based on file extensions.
| Constructor Summary | |
ExtensionFileFilter(java.lang.String extensions)
Create a filter which will accept the given extension (denoted by a comma-separated string) |
|
ExtensionFileFilter(java.lang.String[] ext)
Create a filter which will filter the given extension (denoted by a string array) |
|
ExtensionFileFilter(java.lang.String[] ext,
boolean doAccept)
Create a filter which will filter the given extension (denoted by a string array) |
|
ExtensionFileFilter(java.lang.String extensions,
boolean doAccept)
Create a filter which will accept or refuse the given extension (denoted by a comma-separated string) |
|
| Method Summary | |
boolean |
accept(java.io.File path)
Accept or refuse a file basing on its extension and the current working mode (see getAcceptsExtensions()). |
boolean |
getAcceptsExtensions()
Return true if the filter is currently set to accept files whose extension matches the extensions provided at construction. |
void |
invert()
Invert the filter - after this call, files that were accepted will be refused, and vice versa (see getAcceptsExtensions()). |
java.lang.String |
lastMatchingExtension()
Returns the extension that has been last matched in a call of accept(), or null if accept has never been invoked or
no extension has been matched. |
| 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 extensions)
extensions - a comma-separated string with the extensions
public ExtensionFileFilter(java.lang.String extensions,
boolean doAccept)
extensions - a comma-separated string with the extensionsdoAccept - if true, the filter will accept the files
with the given extensions, refuse otherwise.public ExtensionFileFilter(java.lang.String[] ext)
public ExtensionFileFilter(java.lang.String[] ext,
boolean doAccept)
doAccept - if true, the filter will accept the files
with the given extensions, refuse otherwise.| Method Detail |
public boolean accept(java.io.File path)
getAcceptsExtensions()).
accept in interface java.io.FileFilterpublic void invert()
getAcceptsExtensions()).
public boolean getAcceptsExtensions()
public java.lang.String lastMatchingExtension()
accept(), or null if accept has never been invoked or
no extension has been matched.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||