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 SftpPathIteratorpathIteratorprotected booleanpathIteratorConsumed
-
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 voidclose()SftpClientgetClient()DirectoryStream.Filter<? super Path>getFilter()SftpPathgetRootPath()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
-
pathIteratorConsumed
protected boolean pathIteratorConsumed
-
-
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 remoteSftpPathfilter- An optionalfilter- ignored ifnull- Throws:
IOException- If failed to initialize the directory access handle
-
-
Method Detail
-
getClient
public final SftpClient getClient()
- Specified by:
getClientin interfaceSftpClientHolder
-
getRootPath
public final SftpPath getRootPath()
- Returns:
- The root
SftpPathfor this directory stream
-
getFilter
public final DirectoryStream.Filter<? super Path> getFilter()
- Returns:
- The original filter - may be
nullto indicate no filter
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-