com.ssh.sft
Class DirHandle
java.lang.Object
com.ssh.sft.SftLib
com.ssh.sft.SftBase
com.ssh.sft.ObjectBase
com.ssh.sft.DirHandle
- All Implemented Interfaces:
- Iterator, com.ssh.sft.SftLibConstants
- public class DirHandle
- extends com.ssh.sft.ObjectBase
- implements Iterator
An iterator over directory contents. A DirHandle is used to traverse once through the contents of a directory. It can be used via the standard Iterator
interface, or with the nextEntry()
method. The system resources reserved by a DirHandle object are freed when all entries are iterated, when the object is garbage collected, or when ObjectBase.close()
is called, whichever comes first.
Method Summary |
void | close() Releases the resources used by this object. |
boolean | hasNext() Tests if there are more directory entries still available. |
boolean | isClosed() Tests if this object has been closed. |
Object | next() Returns the next entry in this directory. |
File | nextEntry() Returns the next entry in this directory. |
void | remove() Removes from this directory the last file that was returned by next() or nextEntry() . |
SSH_SFT_REQUEST_MAX_SIZE
public static final int SSH_SFT_REQUEST_MAX_SIZE
- See Also:
- Constant Field Values
SSH_SFT_REQUEST_MAX_NUM
public static final int SSH_SFT_REQUEST_MAX_NUM
- See Also:
- Constant Field Values
SSH_SFT_HASH_MAX_ITERATIONS
public static final int SSH_SFT_HASH_MAX_ITERATIONS
- See Also:
- Constant Field Values
SSH_SFT_HASH_MIN_BLOCK_SIZE
public static final int SSH_SFT_HASH_MIN_BLOCK_SIZE
- See Also:
- Constant Field Values
SSH_SFT_HASH_MAX_BLOCK_SIZE
public static final int SSH_SFT_HASH_MAX_BLOCK_SIZE
- See Also:
- Constant Field Values
SSH_SFT_DIR_RECURSIVE
public static final int SSH_SFT_DIR_RECURSIVE
- See Also:
- Constant Field Values
hasNext
public boolean hasNext()
- Tests if there are more directory entries still available.
- Specified by:
hasNext
in interface Iterator
- Returns:
- true if calling
next()
will return another entry
next
public Object next()
- Returns the next entry in this directory.
- Specified by:
next
in interface Iterator
- Returns:
- the next unread entry in this directory
- Throws:
NoSuchElementException
- if there are no more entries available
nextEntry
public File nextEntry()
throws SftException
- Returns the next entry in this directory.
- Returns:
- the next unread entry in this directory, or null if there are no more entries
- Throws:
SftException
remove
public void remove()
- Removes from this directory the last file that was returned by
next()
or nextEntry()
. - Specified by:
remove
in interface Iterator
close
public void close()
throws SftException
- Releases the resources used by this object. After this method has been called, all further operations on this object will throw a
IllegalStateException
. - Throws:
SftException
isClosed
public boolean isClosed()
- Tests if this object has been closed.
- Returns:
- true if
ObjectBase.close()
has been called on this object, false otherwise