Class NestedJarFile
java.lang.Object
java.util.zip.ZipFile
java.util.jar.JarFile
org.springframework.boot.loader.jar.NestedJarFile
- All Implemented Interfaces:
Closeable
,AutoCloseable
Extended variant of
JarFile
that behaves in the same way but can open nested
jars.- Since:
- 3.2.0
- Author:
- Phillip Webb, Andy Wilkinson
-
Field Summary
Modifier 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
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 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
Fields inherited from class java.util.jar.JarFile
MANIFEST_NAME
Fields inherited from class java.util.zip.ZipFile
OPEN_DELETE, OPEN_READ
-
Constructor Summary
ConstructorDescriptionNestedJarFile
(File file, String nestedEntryName) Creates a newNestedJarFile
instance to read from the specificFile
.NestedJarFile
(File file, String nestedEntryName, Runtime.Version version) Creates a newNestedJarFile
instance to read from the specificFile
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear any internal caches.void
close()
entries()
getInputStream
(ZipEntry entry) getJarEntry
(String name) getName()
boolean
Return if an entry with the given name exists.int
size()
stream()
Methods inherited from class java.util.jar.JarFile
baseVersion, getVersion, isMultiRelease, runtimeVersion
-
Field Details
-
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
-
NestedJarFile
Creates a newNestedJarFile
instance to read from the specificFile
.- Parameters:
file
- the jar file to be opened for readingnestedEntryName
- the nested entry name to open- Throws:
IOException
- on I/O errorIllegalArgumentException
- ifnestedEntryName
isnull
or empty
-
NestedJarFile
Creates a newNestedJarFile
instance to read from the specificFile
.- Parameters:
file
- the jar file to be opened for readingnestedEntryName
- the nested entry name to openversion
- the release version to use when opening a multi-release jar- Throws:
IOException
- on I/O errorIllegalArgumentException
- ifnestedEntryName
isnull
or empty
-
-
Method Details
-
getRawZipDataInputStream
- Throws:
IOException
-
getManifest
- Overrides:
getManifest
in classJarFile
- Throws:
IOException
-
entries
-
stream
-
versionedStream
- Overrides:
versionedStream
in classJarFile
-
getJarEntry
- Overrides:
getJarEntry
in classJarFile
-
getEntry
-
hasEntry
Return if an entry with the given name exists.- Parameters:
name
- the name to check- Returns:
- if the entry exists
-
getInputStream
- Overrides:
getInputStream
in classJarFile
- Throws:
IOException
-
getComment
- Overrides:
getComment
in classZipFile
-
size
public int size() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classZipFile
- Throws:
IOException
-
getName
-
clearCache
public void clearCache()Clear any internal caches.
-