public class ZipCentralDirectoryFileEntry extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZipCentralDirectoryFileEntry.Builder
Builder for the
ZipCentralDirectoryFileEntry . |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DISK_NUMBER |
static int |
INTERNAL_ATTRIBUTES_TEXT_FILE |
static int |
MINIMUM_READ_SIZE
This is the minimum size that this header will take on disk.
|
Constructor and Description |
---|
ZipCentralDirectoryFileEntry(int versionMade,
int versionNeeded,
int generalPurposeFlags,
int compressionMethod,
int lastModifiedTime,
int lastModifiedDate,
long crc32,
long compressedSize,
long uncompressedSize,
int diskNumberStart,
int internalFileAttributes,
int externalFileAttributes,
long relativeOffsetOfLocalHeader,
byte[] fileNameBytes,
byte[] extraFieldBytes,
byte[] commentBytes,
Zip64ExtraField zip64ExtraField) |
Modifier and Type | Method and Description |
---|---|
static ZipCentralDirectoryFileEntry.Builder |
builder()
Make a builder for this class.
|
String |
getComment() |
byte[] |
getCommentBytes() |
long |
getCompressedSize()
Get the 32-bit size of the compressed (encoded) bytes.
|
int |
getCompressionMethod() |
CompressionMethod |
getCompressionMethodAsEnum() |
long |
getCrc32() |
int |
getDiskNumberStart() |
int |
getExternalFileAttributes() |
byte[] |
getExtraFieldBytes() |
String |
getFileName() |
byte[] |
getFileNameBytes() |
int |
getGeneralPurposeFlags() |
Set<GeneralPurposeFlag> |
getGeneralPurposeFlagsAsEnums() |
int |
getInternalFileAttributes() |
int |
getLastModifiedDate() |
String |
getLastModifiedDateString()
Return last modified date as a string in YYYY.mm.dd format.
|
java.time.LocalDateTime |
getLastModifiedDateTime()
Return last modified date and time as a
LocalDateTime . |
int |
getLastModifiedTime() |
String |
getLastModifiedTimeString()
Return last modified time as a string in 24-hour HH:MM:SS format.
|
Platform |
getPlatformMade()
Extract the platform from the version-made information.
|
long |
getRelativeOffsetOfLocalHeader() |
long |
getUncompressedSize()
Get the 32-bit size of the uncompressed, original (unencoded) bytes.
|
int |
getVersionMade() |
int |
getVersionMadeMajorMinor()
Extract the version portion from the version-made information.
|
String |
getVersionMadeMajorMinorString()
Get the version portion of versionMade as a #.# string.
|
int |
getVersionNeeded() |
String |
getVersionNeededMajorMinorString()
Get the version needed value as a #.# string.
|
long |
getZip64CompressedSize()
Get the size of the compressed (unencoded) bytes as encoded in the
Zip64ExtraField which should be in the
extraFieldBytes . |
Zip64ExtraField |
getZip64ExtraField()
Returns the Zip64 extra field in the extra-bytes or null if none.
|
long |
getZip64UncompressedSize()
Get the size of the uncompressed (unencoded) bytes as encoded in the
Zip64ExtraField which should be in
the extraFieldBytes . |
boolean |
isTextFile()
Return whether this is a text file or not based on the internalFileAttributes.
|
static ZipCentralDirectoryFileEntry |
read(RewindableInputStream inputStream)
Read one from the input-stream.
|
String |
toString() |
void |
write(OutputStream outputStream)
Write to the output-stream.
|
public static final int INTERNAL_ATTRIBUTES_TEXT_FILE
public static final int DEFAULT_DISK_NUMBER
public static final int MINIMUM_READ_SIZE
public ZipCentralDirectoryFileEntry(int versionMade, int versionNeeded, int generalPurposeFlags, int compressionMethod, int lastModifiedTime, int lastModifiedDate, long crc32, long compressedSize, long uncompressedSize, int diskNumberStart, int internalFileAttributes, int externalFileAttributes, long relativeOffsetOfLocalHeader, byte[] fileNameBytes, byte[] extraFieldBytes, byte[] commentBytes, Zip64ExtraField zip64ExtraField)
public static ZipCentralDirectoryFileEntry.Builder builder()
public static ZipCentralDirectoryFileEntry read(RewindableInputStream inputStream) throws IOException
IOException
public void write(OutputStream outputStream) throws IOException
IOException
public int getVersionMade()
public Platform getPlatformMade()
public int getVersionMadeMajorMinor()
public String getVersionMadeMajorMinorString()
public int getVersionNeeded()
public String getVersionNeededMajorMinorString()
public int getGeneralPurposeFlags()
public Set<GeneralPurposeFlag> getGeneralPurposeFlagsAsEnums()
public int getCompressionMethod()
public CompressionMethod getCompressionMethodAsEnum()
public int getLastModifiedTime()
public String getLastModifiedTimeString()
public int getLastModifiedDate()
public String getLastModifiedDateString()
public java.time.LocalDateTime getLastModifiedDateTime()
LocalDateTime
.public long getCrc32()
public long getCompressedSize()
Zip64ExtraField
in the getExtraFieldBytes()
that has the real compressed size. See
getZip64CompressedSize()
.public long getZip64CompressedSize()
Zip64ExtraField
which should be in the
extraFieldBytes
. If there is no extra field then the value of the getCompressedSize()
is
returned.public long getUncompressedSize()
Zip64ExtraField
in the getExtraFieldBytes()
that has the real compressed size. See
getZip64UncompressedSize()
.public long getZip64UncompressedSize()
Zip64ExtraField
which should be in
the extraFieldBytes
. If there is no extra field then the value of the getUncompressedSize()
is
returned.public int getDiskNumberStart()
public int getInternalFileAttributes()
public boolean isTextFile()
public int getExternalFileAttributes()
public long getRelativeOffsetOfLocalHeader()
public byte[] getFileNameBytes()
public String getFileName()
public byte[] getExtraFieldBytes()
public byte[] getCommentBytes()
public String getComment()
public Zip64ExtraField getZip64ExtraField()
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.