Class ZipContent.Entry
java.lang.Object
org.springframework.boot.loader.zip.ZipContent.Entry
- Enclosing class:
- ZipContent
A single zip content entry.
-
Method Summary
Modifier and TypeMethodDescription<E extends ZipEntry>
Eas
(BiFunction<ZipContent.Entry, String, E> factory) <E extends ZipEntry>
Eint
Return the compression method for this entry.int
Return the lookup index of the entry.getName()
Return the name of this entry.int
Return the uncompressed size of this entry.boolean
hasNameStartingWith
(CharSequence prefix) Returnstrue
if this entry has a name starting with the given prefix.boolean
Returntrue
if this is a directory entry.Open aDataBlock
providing access to raw contents of the entry (not including the local file header).
-
Method Details
-
getLookupIndex
public int getLookupIndex()Return the lookup index of the entry. Each entry has a unique lookup index but they aren't the same as the order that the entry was loaded.- Returns:
- the entry lookup index
-
isDirectory
public boolean isDirectory()Returntrue
if this is a directory entry.- Returns:
- if the entry is a directory
-
hasNameStartingWith
Returnstrue
if this entry has a name starting with the given prefix.- Parameters:
prefix
- the required prefix- Returns:
- if the entry name starts with the prefix
-
getName
Return the name of this entry.- Returns:
- the entry name
-
getCompressionMethod
public int getCompressionMethod()Return the compression method for this entry.- Returns:
- the compression method
- See Also:
-
getUncompressedSize
public int getUncompressedSize()Return the uncompressed size of this entry.- Returns:
- the uncompressed size
-
openContent
Open aDataBlock
providing access to raw contents of the entry (not including the local file header).To release resources, the
ZipContent.close()
method of the data block should be called explicitly or by try-with-resources.- Returns:
- the contents of the entry
- Throws:
IOException
- on I/O error
-
as
- Type Parameters:
E
- the entry type- Parameters:
factory
- the factory used to create theZipEntry
- Returns:
- a fully populated zip entry
-
as
- Type Parameters:
E
- the entry type- Parameters:
factory
- the factory used to create theZipEntry
- Returns:
- a fully populated zip entry
-