Top Description Fields Constructors Methods
org.apache.sshd.sftp.client.fs

public Class SftpDirectoryStream

extends Object
implements SftpClientHolder, DirectoryStream<Path>
Class Inheritance
All Implemented Interfaces
java.nio.file.DirectoryStream, java.lang.Iterable, java.io.Closeable, java.lang.AutoCloseable, org.apache.sshd.sftp.client.SftpClientHolder
Imports
java.io.IOException, java.nio.file.DirectoryStream, .Path, java.util.Iterator, .Objects, org.apache.sshd.sftp.client.SftpClient, .SftpClientHolder

Implements a remote DirectoryStream
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final DirectoryStream.Filter<? super Path>
private final SftpPath
protected SftpPathIterator
protected boolean
private final SftpClient

Constructor Summary

AccessConstructor and Description
public
public
SftpDirectoryStream(SftpPath
The remote SftpPath
path
,
DirectoryStream.Filter<? super Path>
An optional filter - ignored if null
filter
)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public final SftpClient
public final DirectoryStream.Filter<? super Path>

Returns:

The original filter - may be null to indicate no filter
getFilter
()

public final SftpPath

Returns:

The root SftpPath for this directory stream
getRootPath
()

public Iterator<Path>
iterator()

Implements java.nio.file.DirectoryStream.iterator.

Returns the iterator associated with this DirectoryStream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filterback to summary
private final DirectoryStream.Filter<? super Path> filter
pathback to summary
private final SftpPath path
pathIteratorback to summary
protected SftpPathIterator pathIterator
pathIteratorConsumedback to summary
protected boolean pathIteratorConsumed
sftpback to summary
private final SftpClient sftp

Constructor Detail

SftpDirectoryStreamback to summary
public SftpDirectoryStream(SftpPath path) throws IOException
Parameters
path:SftpPath

The remote SftpPath

Exceptions
IOException:
If failed to initialize the directory access handle
SftpDirectoryStreamback to summary
public SftpDirectoryStream(SftpPath path, DirectoryStream.Filter<? super Path> filter) throws IOException
Parameters
path:SftpPath

The remote SftpPath

filter:DirectoryStream.Filter<? super Path>

An optional filter - ignored if null

Exceptions
IOException:
If failed to initialize the directory access handle

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getClientback to summary
public final SftpClient getClient()

Implements org.apache.sshd.sftp.client.SftpClientHolder.getClient.

Annotations
@Override
getFilterback to summary
public final DirectoryStream.Filter<? super Path> getFilter()
Returns:DirectoryStream.Filter<? super Path>

The original filter - may be null to indicate no filter

getRootPathback to summary
public final SftpPath getRootPath()
Returns:SftpPath

The root SftpPath for this directory stream

iteratorback to summary
public Iterator<Path> iterator()

Implements java.nio.file.DirectoryStream.iterator.

Doc from java.nio.file.DirectoryStream.iterator.

Returns the iterator associated with this DirectoryStream.

Returns:Iterator<Path>

the iterator associated with this DirectoryStream

Annotations
@Override