public class SftpDirEntryIterator extends AbstractLoggingBean implements SftpClientHolder, 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() |
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() |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public 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()
getClient
in interface SftpClientHolder
public 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 Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
protected List<SftpClient.DirEntry> load(SftpClient.Handle handle)
public void remove()
remove
in interface Iterator<SftpClient.DirEntry>
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.