com.ssh.sft Class DirHandle
All Implemented Interfaces: Iterator, 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
interface, or with the
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.
() close Releases the resources used by this object.
() hasNext Tests if there are more directory entries still available.
() 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.
() remove Removes from this directory the last file that was returned by or
public boolean hasNext() Tests if there are more directory entries still available. Specified by:
hasNext Iterator Returns: true if calling will return another entry
public Object next() Returns the next entry in this directory. Specified by:
next Iterator Returns: the next unread entry in this directory Throws:
- if there are no more entries available
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 or
remove 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 .
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
Did You Know? SSH Communications Security is the company behind SSH (Secure Shell). Founded by SSH inventor. We are the subject matter experts on SSH, SSH key management, and generally secure access to remote servers. PrivX: Next Generation Privileged Access Management PrivX On-Demand Access Manager fundamentally changes how privileged access is done. Much easier to deploy and operate. Scales beautifully to cloud, elastic services, and DevOps. Save costs and improve reliability. Eliminate passwords from servers entirely. VIDEO Contact Us