Class ZipEntryUtil
java.lang.Object
org.zeroturnaround.zip.ZipEntryUtil
Util class for static methods shared between ZipUtil and Zips.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidaddEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream out) Adds a given ZIP entry to a ZIP file.(package private) static ZipEntryCopy entry(package private) static ZipEntryCopy entry with another name.(package private) static voidcopyEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream out) Copies a given ZIP entry to a ZIP file.(package private) static voidcopyEntry(ZipEntry originalEntry, InputStream in, ZipOutputStream out, boolean preserveTimestamps) Copies a given ZIP entry to a ZIP file.(package private) static ZipEntryCreate new Zip entry and fill it with associated with file meta-infoprivate static AsiExtraFieldgetFirstAsiExtraField(List<ZipExtraField> fields) (package private) static ZTFilePermissionsgetZTFilePermissions(ZipEntry zipEntry) Get assigned to ZIP entry file permissions info.(package private) static booleansetZTFilePermissions(ZipEntry zipEntry, ZTFilePermissions permissions) Add file permissions info to ZIP entry.
-
Constructor Details
-
ZipEntryUtil
private ZipEntryUtil()
-
-
Method Details
-
copy
-
copy
-
copyEntry
Copies a given ZIP entry to a ZIP file.- Parameters:
zipEntry- a ZIP entry from existing ZIP file.in- contents of the ZIP entry.out- target ZIP stream.- Throws:
IOException
-
copyEntry
static void copyEntry(ZipEntry originalEntry, InputStream in, ZipOutputStream out, boolean preserveTimestamps) throws IOException Copies a given ZIP entry to a ZIP file. If this.preserveTimestamps is true, original timestamp is carried over, otherwise uses current time.- Parameters:
originalEntry- a ZIP entry from existing ZIP file.in- contents of the ZIP entry.out- target ZIP stream.- Throws:
IOException
-
addEntry
Adds a given ZIP entry to a ZIP file.- Parameters:
zipEntry- new ZIP entry.in- contents of the ZIP entry.out- target ZIP stream.- Throws:
IOException
-
fromFile
-
setZTFilePermissions
Add file permissions info to ZIP entry. Current implementation adds "ASi Unix" (tag 0x756e) extra block to entry.- Parameters:
zipEntry- ZIP entrypermissions- permissions to assign
-
getZTFilePermissions
Get assigned to ZIP entry file permissions info. Current implementation tries to read "ASi Unix" (tag 0x756e) extra tag. "ASi Unix"- Parameters:
zipEntry-- Returns:
- file permissions info or
nullif ZIP entry does not have "ASi Unix" extra field.
-
getFirstAsiExtraField
-