Class JavaZipFileHandle

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.zip.ZipFile zipFile  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaZipFileHandle​(java.io.File targetFile)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the zip handle (performs resource cleanup).
      java.util.List<java.lang.String> getEntries()
      Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.
      java.util.List<java.lang.String> getEntries​(EntryNameFilter filter)
      Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.
      java.io.InputStream getEntryContent​(java.lang.String path)
      Returns the "payload" (uncompressed) of the entry at given path, or null if no such path exists in the Zip file this handle points to.
      protected java.util.zip.ZipFile getZipFile()  
      boolean hasEntry​(java.lang.String path)
      Returns true if Zip file this handle is pointing to contains an entry at given path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • zipFile

        private final java.util.zip.ZipFile zipFile
    • Constructor Detail

      • JavaZipFileHandle

        public JavaZipFileHandle​(java.io.File targetFile)
                          throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getZipFile

        protected java.util.zip.ZipFile getZipFile()
      • hasEntry

        public boolean hasEntry​(java.lang.String path)
                         throws java.io.IOException
        Description copied from interface: ZipHandle
        Returns true if Zip file this handle is pointing to contains an entry at given path.
        Specified by:
        hasEntry in interface ZipHandle
        Returns:
        Throws:
        java.io.IOException
      • getEntries

        public java.util.List<java.lang.String> getEntries()
        Description copied from interface: ZipHandle
        Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.
        Specified by:
        getEntries in interface ZipHandle
        Returns:
      • getEntries

        public java.util.List<java.lang.String> getEntries​(EntryNameFilter filter)
        Description copied from interface: ZipHandle
        Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.
        Specified by:
        getEntries in interface ZipHandle
        Returns:
      • getEntryContent

        public java.io.InputStream getEntryContent​(java.lang.String path)
                                            throws java.io.IOException
        Description copied from interface: ZipHandle
        Returns the "payload" (uncompressed) of the entry at given path, or null if no such path exists in the Zip file this handle points to.
        Specified by:
        getEntryContent in interface ZipHandle
        Returns:
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: ZipHandle
        Closes the zip handle (performs resource cleanup). This method should be called when this zip handle is not needed anymore, and calling it should be obligatory to prevent resource leaks.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface ZipHandle
        Throws:
        java.io.IOException