Class ZipEntryIterator

  • All Implemented Interfaces:
    java.util.Iterator<java.lang.String>

    final class ZipEntryIterator
    extends java.lang.Object
    implements java.util.Iterator<java.lang.String>
    Iterator that iterates over named entries inside JAR or ZIP resources.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] entryNames  
      private int index  
    • Constructor Summary

      Constructors 
      Constructor Description
      ZipEntryIterator​(java.net.URL url)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String[] getEntryNames​(java.util.zip.ZipFile zipFile)
      Returns a string array listing the entries in the given zip file.
      private static java.lang.String[] getEntryNames​(java.util.zip.ZipInputStream zipStream)
      Returns a string array listing the entries in the given zip stream.
      boolean hasNext()  
      java.lang.String next()  
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • entryNames

        private java.lang.String[] entryNames
      • index

        private int index
    • Constructor Detail

      • ZipEntryIterator

        ZipEntryIterator​(java.net.URL url)
    • Method Detail

      • hasNext

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

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

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<java.lang.String>
      • getEntryNames

        private static java.lang.String[] getEntryNames​(java.util.zip.ZipFile zipFile)
                                                 throws java.io.IOException
        Returns a string array listing the entries in the given zip file.
        Parameters:
        zipFile - The zip file
        Returns:
        Array of entry names
        Throws:
        java.io.IOException
      • getEntryNames

        private static java.lang.String[] getEntryNames​(java.util.zip.ZipInputStream zipStream)
                                                 throws java.io.IOException
        Returns a string array listing the entries in the given zip stream.
        Parameters:
        zipStream - The zip stream
        Returns:
        Array of entry names
        Throws:
        java.io.IOException