org.edg.security.trustmanager
Class FileEndingIterator

java.lang.Object
  |
  +--org.edg.security.trustmanager.FileEndingIterator

public class FileEndingIterator
extends java.lang.Object

Lists all the files in the given directory that end with a certain ending.


Field Summary
protected  java.lang.String ending
          The file ending.
protected  java.io.File[] fileList
          The list of files in the directory.
protected  int index
          The index of the next match in the fileList.
protected  boolean nextFound
          A flag to show that there are more files that match.
 
Constructor Summary
FileEndingIterator(java.lang.String path, java.lang.String ending)
          Creates new FileIterator and searches the first match.
 
Method Summary
protected  boolean findNext()
          Finds the next matching file in the list of files.
 boolean hasNext()
          Used to check that there are more matching files to get using next().
 java.io.File next()
          Used to get the next matching file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ending

protected java.lang.String ending
The file ending.


nextFound

protected boolean nextFound
A flag to show that there are more files that match.


fileList

protected java.io.File[] fileList
The list of files in the directory.


index

protected int index
The index of the next match in the fileList.

Constructor Detail

FileEndingIterator

public FileEndingIterator(java.lang.String path,
                          java.lang.String ending)
Creates new FileIterator and searches the first match.

Parameters:
path - The directory used for the file search.
ending - The file ending to search for.
Method Detail

next

public java.io.File next()
Used to get the next matching file.

Returns:
Returns the next matching file.

hasNext

public boolean hasNext()
Used to check that there are more matching files to get using next().

Returns:
Returns true if there are more matching files.

findNext

protected boolean findNext()
Finds the next matching file in the list of files.

Returns:
Returns true if a matching file was found.