Class JarFile
java.lang.Object
java.util.zip.ZipFile
java.util.jar.JarFile
org.springframework.boot.loader.jar.JarFile
- All Implemented Interfaces:
 Closeable,AutoCloseable,Iterable<JarEntry>
Extended variant of 
JarFile that behaves in the same way but
 offers the following additional functionality.
 - Since:
 - 1.0.0
 - Author:
 - Phillip Webb, Andy Wilkinson
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intFields inherited from class java.util.zip.ZipFile
OPEN_DELETE, OPEN_READ - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()booleancontainsEntry(String name) entries()getInputStream(ZipEntry entry) org.springframework.boot.loader.jar.JarEntrygetJarEntry(CharSequence name) org.springframework.boot.loader.jar.JarEntrygetJarEntry(String name) getName()getNestedJarFile(ZipEntry entry) Return a nestedJarFileloaded from the specified entry.getNestedJarFile(org.springframework.boot.loader.jar.JarEntry entry) Return a nestedJarFileloaded from the specified entry.protected Stringprotected final RandomAccessDataFilegetUrl()iterator()Return an iterator for the contained entries.static voidRegister a 'java.protocol.handler.pkgs' property so that aURLStreamHandlerwill be located to deal with jar URLs.intsize()stream()toString()Methods inherited from class java.util.jar.JarFile
baseVersion, getVersion, isMultiRelease, runtimeVersion, versionedStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator 
- 
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
- 
JarFile
Create a newJarFilebacked by the specified file.- Parameters:
 file- the root jar file- Throws:
 IOException- if the file cannot be read
 
 - 
 - 
Method Details
- 
getRootJarFile
 - 
getManifest
- Overrides:
 getManifestin classJarFile- Throws:
 IOException
 - 
entries
 - 
stream
 - 
iterator
Return an iterator for the contained entries. - 
getJarEntry
 - 
getJarEntry
- Overrides:
 getJarEntryin classJarFile
 - 
containsEntry
 - 
getEntry
 - 
getInputStream
- Overrides:
 getInputStreamin classJarFile- Throws:
 IOException
 - 
getNestedJarFile
Return a nestedJarFileloaded from the specified entry.- Parameters:
 entry- the zip entry- Returns:
 - a 
JarFilefor the entry - Throws:
 IOException- if the nested jar file cannot be read
 - 
getNestedJarFile
public JarFile getNestedJarFile(org.springframework.boot.loader.jar.JarEntry entry) throws IOException Return a nestedJarFileloaded from the specified entry.- Parameters:
 entry- the zip entry- Returns:
 - a 
JarFilefor the entry - Throws:
 IOException- if the nested jar file cannot be read
 - 
getComment
- Overrides:
 getCommentin classZipFile
 - 
size
public int size() - 
close
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Overrides:
 closein classZipFile- Throws:
 IOException
 - 
getUrl
- Throws:
 MalformedURLException
 - 
toString
 - 
getName
 - 
clearCache
public void clearCache() - 
getPathFromRoot
 - 
registerUrlProtocolHandler
public static void registerUrlProtocolHandler()Register a 'java.protocol.handler.pkgs' property so that aURLStreamHandlerwill be located to deal with jar URLs. 
 -