Package org.jboss.vfs

Class VirtualJarInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class VirtualJarInputStream
    extends java.util.jar.JarInputStream
    Virtual JarInputStream used for representing any VFS directory as a JarInputStream.
    • Constructor Detail

      • VirtualJarInputStream

        public VirtualJarInputStream​(VirtualFile root)
                              throws java.io.IOException
        Construct a VirtualJarInputStream from a VirtualFile root
        Parameters:
        root - VirtualFile directory to use as the base of the virtual Jar.
        Throws:
        java.io.IOException
    • Method Detail

      • getNextEntry

        public java.util.zip.ZipEntry getNextEntry()
                                            throws java.io.IOException
        *
        Overrides:
        getNextEntry in class java.util.jar.JarInputStream
        Throws:
        java.io.IOException
      • getNextJarEntry

        public java.util.jar.JarEntry getNextJarEntry()
                                               throws java.io.IOException
        *
        Overrides:
        getNextJarEntry in class java.util.jar.JarInputStream
        Throws:
        java.io.IOException
      • getManifest

        public java.util.jar.Manifest getManifest()
        *
        Overrides:
        getManifest in class java.util.jar.JarInputStream
      • read

        public int read()
                 throws java.io.IOException
        *
        Overrides:
        read in class java.util.zip.InflaterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        *
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        *
        Overrides:
        read in class java.util.jar.JarInputStream
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        *
        Overrides:
        available in class java.util.zip.ZipInputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        *
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.util.zip.ZipInputStream
        Throws:
        java.io.IOException
      • closeEntry

        public void closeEntry()
                        throws java.io.IOException
        *
        Overrides:
        closeEntry in class java.util.zip.ZipInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        *
        Overrides:
        skip in class java.util.zip.ZipInputStream
        Throws:
        java.io.IOException
      • ensureOpen

        private void ensureOpen()
                         throws java.io.IOException
        *
        Throws:
        java.io.IOException
      • checkForEoSAndReturn

        private int checkForEoSAndReturn​(int result)
                                  throws java.io.IOException
        Check to see if the result is the EOF and if so exchange the current entry stream with the empty stream.
        Parameters:
        result -
        Returns:
        int result
        Throws:
        java.io.IOException
      • openCurrent

        private void openCurrent​(VirtualFile current)
                          throws java.io.IOException
        Open the current virtual file as the current JarEntry stream.
        Parameters:
        current -
        Throws:
        java.io.IOException
      • getEntryName

        private java.lang.String getEntryName​(VirtualFile entry)
        Get the entry name from a VirtualFile.
        Parameters:
        entry -
        Returns:
      • fixDirectoryName

        private java.lang.String fixDirectoryName​(java.lang.String name)
        Make sure directory names end with a trailing slash
        Parameters:
        name -
        Returns: