Class JavaPath.ZipEntryWrapper

  • All Implemented Interfaces:
    JavaPath.FileWrapper
    Enclosing class:
    JavaPath

    static class JavaPath.ZipEntryWrapper
    extends java.lang.Object
    implements JavaPath.FileWrapper
    Represents a file entry which is an entry in a zip-file zipFile. The zip-file may be in any zip format and in particular a jar-archive (which is the common application case).
    • Field Summary

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

      Constructors 
      Constructor Description
      ZipEntryWrapper​(java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry entry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean coversZip()
      Returns whether the wrapped file is within a zip-archive.
      java.io.File getFile()
      Returns the file wrapped.
      java.io.InputStream getInputStream()
      Returns an input stream for the file wrapped.
      • 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
      • entry

        private final java.util.zip.ZipEntry entry
    • Constructor Detail

      • ZipEntryWrapper

        ZipEntryWrapper​(java.util.zip.ZipFile zipFile,
                        java.util.zip.ZipEntry entry)
    • Method Detail

      • coversZip

        public boolean coversZip()
        Description copied from interface: JavaPath.FileWrapper
        Returns whether the wrapped file is within a zip-archive. If this is the case, the file wrapped was created newly.
        Specified by:
        coversZip in interface JavaPath.FileWrapper
        Returns:
        a boolean value signifying whether the wrapped file is within a zip-archive.
      • getFile

        public java.io.File getFile()
                             throws java.io.IOException
        Description copied from interface: JavaPath.FileWrapper
        Returns the file wrapped. If the wrapped file is within a zip-archive, it was created newly by this FileWrapper.
        Specified by:
        getFile in interface JavaPath.FileWrapper
        Returns:
        the File wrapped.
        Throws:
        java.io.IOException - if an error occurs
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from interface: JavaPath.FileWrapper
        Returns an input stream for the file wrapped.
        Specified by:
        getInputStream in interface JavaPath.FileWrapper
        Returns:
        the InputStream of the file wrapped.
        Throws:
        java.io.IOException - if an error occurs