public class SftpDirectoryStream
extends java.lang.Object
implements java.nio.file.DirectoryStream<java.nio.file.Path>
DirectoryStream
Modifier and Type | Field and Description |
---|---|
private java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> |
filter |
private SftpPath |
path |
protected SftpPathIterator |
pathIterator |
private SftpClient |
sftp |
Constructor and Description |
---|
SftpDirectoryStream(SftpPath path) |
SftpDirectoryStream(SftpPath path,
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
SftpClient |
getClient()
Client instance used to access the remote directory
|
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> |
getFilter() |
SftpPath |
getRootPath() |
java.util.Iterator<java.nio.file.Path> |
iterator() |
protected SftpPathIterator pathIterator
private final SftpPath path
private final java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter
private final SftpClient sftp
public SftpDirectoryStream(SftpPath path) throws java.io.IOException
path
- The remote SftpPath
java.io.IOException
- If failed to initialize the directory access handlepublic SftpDirectoryStream(SftpPath path, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws java.io.IOException
path
- The remote SftpPath
filter
- An optional filter
- ignored if
null
java.io.IOException
- If failed to initialize the directory access handlepublic final SftpClient getClient()
SftpClient
instance used to access the remote directorypublic final SftpPath getRootPath()
SftpPath
for this directory streampublic final java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> getFilter()
null
to indicate no filterpublic java.util.Iterator<java.nio.file.Path> iterator()
iterator
in interface java.lang.Iterable<java.nio.file.Path>
iterator
in interface java.nio.file.DirectoryStream<java.nio.file.Path>
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException