|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.util.html.DirFilter
public class DirFilter extends Object implements FilenameFilter
The DirFilter class determines if a File object is a directory.
This example creates a DirFilter object to determine which IFSJavaFile objects are directories.
// Create an IFSJavaFile object. IFSJavaFile root = new IFSJavaFile(system, "/QIBM");// Create a DirFilter object. DirFilter filter = new DirFilter();
// Get the list of directories. File[] dirList = root.listFiles(filter);
// Create a tree element with each directory. for (int i=0; i < dirList.length; i++) { FileTreeElement node = new FileTreeElement(dirList[i]);
ServletHyperlink sl = new ServletHyperlink(urlParser.getURI()); sl.setHttpServletResponse(resp); node.setIconUrl(sl);
tree.addElement(node); }
FileTreeElement
Constructor and Description |
---|
DirFilter()
Constructs a default DirFilter object. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File file,
String filename)
Determines if a file should be included in a list of directories. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DirFilter()
Method Detail |
---|
public boolean accept(File file, String filename)
accept
in interface FilenameFilter
file
- The directory in which the file was found.filename
- The name of the file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |