org.apache.avalon.excalibur.io
クラス InvertedFileFilter
java.lang.Object
|
+--org.apache.avalon.excalibur.io.InvertedFileFilter
- すべての実装インタフェース:
- java.io.FilenameFilter
- public class InvertedFileFilter
- extends java.lang.Object
- implements java.io.FilenameFilter
This takes a FilenameFilter as input and inverts the selection.
This is used in retrieving files that are not accepted by a filter.
Eg., here is how one could use InvertedFileFilter
in conjunction with
ExtensionFileFilter
to print all files not ending in
.bak
or .BAK
in the current directory:
File dir = new File(".");
String[] files = dir.list(
new InvertedFileFilter(
new ExtensionFileFilter( new String[]{".bak", ".BAK"} )
)
);
for ( int i=0; i<files.length; i++ )
{
System.out.println(files[i]);
}
- 導入されたバージョン:
- 4.0
- バージョン:
- CVS $Revision: 1.4 $ $Date: 2001/12/11 09:53:29 $
- 作成者:
- Harmeet Bedi
メソッドの概要 |
boolean |
accept(java.io.File file,
java.lang.String name)
|
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InvertedFileFilter
public InvertedFileFilter(java.io.FilenameFilter originalFilter)
accept
public boolean accept(java.io.File file,
java.lang.String name)
- 定義:
- インタフェース
java.io.FilenameFilter
内の accept
"Copyright ? 2001 Apache Jakarta Project. All Rights Reserved."