Class SftpDirectoryStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<java.nio.file.Path>, java.nio.file.DirectoryStream<java.nio.file.Path>

    public class SftpDirectoryStream
    extends java.lang.Object
    implements java.nio.file.DirectoryStream<java.nio.file.Path>
    Implements a remote DirectoryStream
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.nio.file.DirectoryStream

        java.nio.file.DirectoryStream.Filter<T extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      • 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

      • filter

        private final java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter
    • Constructor Detail

      • SftpDirectoryStream

        public SftpDirectoryStream​(SftpPath path)
                            throws java.io.IOException
        Parameters:
        path - The remote SftpPath
        Throws:
        java.io.IOException - If failed to initialize the directory access handle
      • SftpDirectoryStream

        public SftpDirectoryStream​(SftpPath path,
                                   java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
                            throws java.io.IOException
        Parameters:
        path - The remote SftpPath
        filter - An optional filter - ignored if null
        Throws:
        java.io.IOException - If failed to initialize the directory access handle
    • Method Detail

      • getClient

        public final SftpClient getClient()
        Client instance used to access the remote directory
        Returns:
        The SftpClient instance used to access the remote directory
      • getRootPath

        public final SftpPath getRootPath()
        Returns:
        The root SftpPath for this directory stream
      • getFilter

        public final java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> getFilter()
        Returns:
        The original filter - may be null to indicate no filter
      • iterator

        public java.util.Iterator<java.nio.file.Path> iterator()
        Specified by:
        iterator in interface java.nio.file.DirectoryStream<java.nio.file.Path>
        Specified by:
        iterator in interface java.lang.Iterable<java.nio.file.Path>
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException