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
public class SftpDirectoryStream extends Object implements SftpClientHolder, DirectoryStream<Path>
Implements a remoteDirectoryStream
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.nio.file.DirectoryStream
DirectoryStream.Filter<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected SftpPathIterator
pathIterator
-
Constructor Summary
Constructors Constructor Description SftpDirectoryStream(SftpPath path)
SftpDirectoryStream(SftpPath path, DirectoryStream.Filter<? super Path> filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
SftpClient
getClient()
DirectoryStream.Filter<? super Path>
getFilter()
SftpPath
getRootPath()
Iterator<Path>
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 Detail
-
pathIterator
protected SftpPathIterator pathIterator
-
-
Constructor Detail
-
SftpDirectoryStream
public SftpDirectoryStream(SftpPath path) throws IOException
- 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 Detail
-
getClient
public final SftpClient getClient()
- Specified by:
getClient
in interfaceSftpClientHolder
-
getRootPath
public final SftpPath getRootPath()
- Returns:
- The root
SftpPath
for this directory stream
-
getFilter
public final DirectoryStream.Filter<? super Path> getFilter()
- Returns:
- The original filter - may be
null
to indicate no filter
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-