Package org.jboss.vfs
Class VirtualJarInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.util.zip.InflaterInputStream
java.util.zip.ZipInputStream
java.util.jar.JarInputStream
org.jboss.vfs.VirtualJarInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Virtual JarInputStream used for representing any VFS directory as a JarInputStream.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Virtual JarEntry used for representing a child VirtualFile as a JarEntry. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final long
static final int
static final int
static final int
static final int
private boolean
private InputStream
private VirtualFile
static final int
static final int
static final int
static final long
static final int
static final int
static final int
private final Deque
<Iterator<VirtualFile>> static final int
static final int
static final int
static final long
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final long
static final int
static final int
static final int
private final Manifest
private static final VirtualFileFilter
private static final String
private static final String
private final VirtualFile
Fields inherited from class java.util.zip.InflaterInputStream
buf, inf, len
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
*private int
checkForEoSAndReturn
(int result) Check to see if the result is the EOF and if so exchange the current entry stream with the empty stream.void
close()
*void
*private void
*private String
fixDirectoryName
(String name) Make sure directory names end with a trailing slashprivate String
getEntryName
(VirtualFile entry) Get the entry name from a VirtualFile.***private void
openCurrent
(VirtualFile current) Open the current virtual file as the current JarEntry stream.int
read()
*int
read
(byte[] b) *int
read
(byte[] b, int off, int len) *long
skip
(long n) *Methods inherited from class java.util.jar.JarInputStream
createZipEntry
Methods inherited from class java.util.zip.ZipInputStream
readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
Methods inherited from class java.util.zip.InflaterInputStream
fill, mark, markSupported, reset
Methods inherited from class java.io.InputStream
nullInputStream
-
Field Details
-
MANIFEST_NAME
- See Also:
-
META_INF_DIR
- See Also:
-
MANIFEST_FILTER
-
entryItr
-
root
-
manifest
-
currentVirtualFile
-
currentEntryStream
-
closed
private boolean closed -
LOCSIG
static final long LOCSIG- See Also:
-
EXTSIG
static final long EXTSIG- See Also:
-
CENSIG
static final long CENSIG- See Also:
-
ENDSIG
static final long ENDSIG- See Also:
-
LOCHDR
static final int LOCHDR- See Also:
-
EXTHDR
static final int EXTHDR- See Also:
-
CENHDR
static final int CENHDR- See Also:
-
ENDHDR
static final int ENDHDR- See Also:
-
LOCVER
static final int LOCVER- See Also:
-
LOCFLG
static final int LOCFLG- See Also:
-
LOCHOW
static final int LOCHOW- See Also:
-
LOCTIM
static final int LOCTIM- See Also:
-
LOCCRC
static final int LOCCRC- See Also:
-
LOCSIZ
static final int LOCSIZ- See Also:
-
LOCLEN
static final int LOCLEN- See Also:
-
LOCNAM
static final int LOCNAM- See Also:
-
LOCEXT
static final int LOCEXT- See Also:
-
EXTCRC
static final int EXTCRC- See Also:
-
EXTSIZ
static final int EXTSIZ- See Also:
-
EXTLEN
static final int EXTLEN- See Also:
-
CENVEM
static final int CENVEM- See Also:
-
CENVER
static final int CENVER- See Also:
-
CENFLG
static final int CENFLG- See Also:
-
CENHOW
static final int CENHOW- See Also:
-
CENTIM
static final int CENTIM- See Also:
-
CENCRC
static final int CENCRC- See Also:
-
CENSIZ
static final int CENSIZ- See Also:
-
CENLEN
static final int CENLEN- See Also:
-
CENNAM
static final int CENNAM- See Also:
-
CENEXT
static final int CENEXT- See Also:
-
CENCOM
static final int CENCOM- See Also:
-
CENDSK
static final int CENDSK- See Also:
-
CENATT
static final int CENATT- See Also:
-
CENATX
static final int CENATX- See Also:
-
CENOFF
static final int CENOFF- See Also:
-
ENDSUB
static final int ENDSUB- See Also:
-
ENDTOT
static final int ENDTOT- See Also:
-
ENDSIZ
static final int ENDSIZ- See Also:
-
ENDOFF
static final int ENDOFF- See Also:
-
ENDCOM
static final int ENDCOM- See Also:
-
-
Constructor Details
-
VirtualJarInputStream
Construct aVirtualJarInputStream
from aVirtualFile
root- Parameters:
root
- VirtualFile directory to use as the base of the virtual Jar.- Throws:
IOException
-
-
Method Details
-
getNextEntry
*- Overrides:
getNextEntry
in classJarInputStream
- Throws:
IOException
-
getNextJarEntry
*- Overrides:
getNextJarEntry
in classJarInputStream
- Throws:
IOException
-
getManifest
*- Overrides:
getManifest
in classJarInputStream
-
read
*- Overrides:
read
in classZipInputStream
- Throws:
IOException
-
read
*- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
*- Overrides:
read
in classJarInputStream
- Throws:
IOException
-
available
*- Overrides:
available
in classZipInputStream
- Throws:
IOException
-
close
*- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classZipInputStream
- Throws:
IOException
-
closeEntry
*- Overrides:
closeEntry
in classZipInputStream
- Throws:
IOException
-
skip
*- Overrides:
skip
in classZipInputStream
- Throws:
IOException
-
ensureOpen
*- Throws:
IOException
-
checkForEoSAndReturn
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:
IOException
-
openCurrent
Open the current virtual file as the current JarEntry stream.- Parameters:
current
-- Throws:
IOException
-
getEntryName
Get the entry name from a VirtualFile.- Parameters:
entry
-- Returns:
-
fixDirectoryName
Make sure directory names end with a trailing slash- Parameters:
name
-- Returns:
-