public class SftpDirEntryIterator extends AbstractLoggingBean implements Iterator<SftpClient.DirEntry>, Channel
log| Constructor and Description |
|---|
SftpDirEntryIterator(SftpClient client,
SftpClient.Handle dirHandle) |
SftpDirEntryIterator(SftpClient client,
String path) |
SftpDirEntryIterator(SftpClient client,
String path,
SftpClient.Handle dirHandle,
boolean closeOnFinished) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
SftpClient |
getClient()
The client instance
|
SftpClient.Handle |
getHandle() |
String |
getPath()
The remotely accessed directory path
|
boolean |
hasNext() |
boolean |
isCloseOnFinished() |
boolean |
isOpen() |
protected List<SftpClient.DirEntry> |
load(SftpClient.Handle handle) |
SftpClient.DirEntry |
next() |
void |
remove() |
getSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic SftpDirEntryIterator(SftpClient client, String path) throws IOException
client - The SftpClient instance to use for the iterationpath - The remote directory pathIOException - If failed to gain access to the remote directory pathpublic SftpDirEntryIterator(SftpClient client, SftpClient.Handle dirHandle)
client - The SftpClient instance to use for the iterationdirHandle - The directory SftpClient.Handle to use for listing the entriespublic SftpDirEntryIterator(SftpClient client, String path, SftpClient.Handle dirHandle, boolean closeOnFinished)
client - The SftpClient instance to use for the iterationpath - A hint as to the remote directory path - used only for loggingdirHandle - The directory SftpClient.Handle to use for listing the entriescloseOnFinished - If true then close the directory handle when
all entries have been exhaustedpublic final SftpClient getClient()
SftpClient instance used to access the remote folderpublic final String getPath()
SftpClient.Handle instead of via a path - used only for loggingpublic final SftpClient.Handle getHandle()
SftpClient.Handle used to access the remote directorypublic boolean hasNext()
hasNext in interface Iterator<SftpClient.DirEntry>public SftpClient.DirEntry next()
next in interface Iterator<SftpClient.DirEntry>public boolean isCloseOnFinished()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionprotected List<SftpClient.DirEntry> load(SftpClient.Handle handle)
public void remove()
remove in interface Iterator<SftpClient.DirEntry>Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.