Secure iNet Factory

com.jscape.util
Class DiskIterator

java.lang.Object
  extended by com.jscape.util.DiskIterator
All Implemented Interfaces:
java.util.Enumeration

public class DiskIterator
extends java.lang.Object
implements java.util.Enumeration

This class provides Enumeration-like interface to files on filesystem.


Field Summary
static int MAX_FILES_IN_DIR
           
static int MAX_RECURSE
           
 
Constructor Summary
DiskIterator(java.lang.String rootdir, java.lang.String filter, boolean recurse, boolean dirs, boolean matchdirs)
          Creates DiskIterator to iterate from rootdir and return files matching filter.
 
Method Summary
 boolean hasMoreElements()
           
 boolean match(java.lang.String pattern, java.lang.String string)
           
 java.lang.Object nextElement()
          Returns next file as defined in constructor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_RECURSE

public static int MAX_RECURSE

MAX_FILES_IN_DIR

public static int MAX_FILES_IN_DIR
Constructor Detail

DiskIterator

public DiskIterator(java.lang.String rootdir,
                    java.lang.String filter,
                    boolean recurse,
                    boolean dirs,
                    boolean matchdirs)
Creates DiskIterator to iterate from rootdir and return files matching filter. If recurse is true, DiskIterator will recurse rootdir subdirectories, and if dirs is true, nextElement will return directory entries too. If matchdirs is true, patterns will be matched using absolute path instead of filenames only. You may use this in conjunction with * wildcard ; for example *.java will match all .java files in all dirs. Wildcards allowed are ? (any character) and *(any number of any characters), and | (multiple patterns separator).

Method Detail

nextElement

public java.lang.Object nextElement()
Returns next file as defined in constructor. Note that return value is java.io.JFile.

Specified by:
nextElement in interface java.util.Enumeration

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration

match

public boolean match(java.lang.String pattern,
                     java.lang.String string)

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved