Class DirIterator

java.lang.Object
xyz.cofe.io.fs.DirIterator
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<File>

public class DirIterator
extends java.lang.Object
implements java.util.Iterator<File>, java.io.Closeable
Итератор по каталогу
Author:
Kamnev Georgiy
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Iterator<java.nio.file.Path> diterator  
    protected java.nio.file.DirectoryStream<java.nio.file.Path> dstream  
  • Constructor Summary

    Constructors 
    Constructor Description
    DirIterator​(java.nio.file.Path path)  
    DirIterator​(File path)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    protected void finalize()  
    protected void finish()  
    boolean hasNext()  
    File next()  
    void remove()  

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Field Details

    • dstream

      protected java.nio.file.DirectoryStream<java.nio.file.Path> dstream
    • diterator

      protected java.util.Iterator<java.nio.file.Path> diterator
  • Constructor Details

    • DirIterator

      public DirIterator​(java.nio.file.Path path) throws java.io.IOException
      Throws:
      java.io.IOException
    • DirIterator

      public DirIterator​(File path) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • finalize

      protected void finalize() throws java.lang.Throwable
      Overrides:
      finalize in class java.lang.Object
      Throws:
      java.lang.Throwable
    • finish

      protected void finish()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<File>
    • next

      public File next()
      Specified by:
      next in interface java.util.Iterator<File>
    • remove

      public void remove()
      Specified by:
      remove in interface java.util.Iterator<File>
    • 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