Package org.apache.sshd.sftp.client.fs
Class SftpDirectoryStream
java.lang.Object
org.apache.sshd.sftp.client.fs.SftpDirectoryStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<Path>
,DirectoryStream<Path>
,SftpClientHolder
Implements a remote
DirectoryStream
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.nio.file.DirectoryStream
DirectoryStream.Filter<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DirectoryStream.Filter
<? super Path> private final SftpPath
protected SftpPathIterator
protected boolean
private final SftpClient
-
Constructor Summary
ConstructorsConstructorDescriptionSftpDirectoryStream
(SftpPath path) SftpDirectoryStream
(SftpPath path, DirectoryStream.Filter<? super Path> filter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
final SftpClient
final DirectoryStream.Filter
<? super Path> final SftpPath
iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
pathIterator
-
pathIteratorConsumed
protected boolean pathIteratorConsumed -
path
-
filter
-
sftp
-
-
Constructor Details
-
SftpDirectoryStream
- Parameters:
path
- The remoteSftpPath
- Throws:
IOException
- If failed to initialize the directory access handle
-
SftpDirectoryStream
public SftpDirectoryStream(SftpPath path, DirectoryStream.Filter<? super Path> filter) throws IOException - Parameters:
path
- The remoteSftpPath
filter
- An optionalfilter
- ignored ifnull
- Throws:
IOException
- If failed to initialize the directory access handle
-
-
Method Details
-
getClient
- Specified by:
getClient
in interfaceSftpClientHolder
-
getRootPath
- Returns:
- The root
SftpPath
for this directory stream
-
getFilter
- Returns:
- The original filter - may be
null
to indicate no filter
-
iterator
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-