Package aQute.lib.zip
Class ZipUtil
java.lang.Object
aQute.lib.zip.ZipUtil
This class provides utilities to work with zip files.
http://www.opensource.apple.com/source/zip/zip-6/unzip/unzip/proginfo/extra.
fld
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Clean the input path to avoid ZipSlip issues.static long
getModifiedTime
(ZipEntry entry) static boolean
isCompromised
(String path) static void
setModifiedTime
(ZipEntry entry, long utc)
-
Field Details
-
tz
-
-
Constructor Details
-
ZipUtil
public ZipUtil()
-
-
Method Details
-
getModifiedTime
-
setModifiedTime
-
cleanPath
Clean the input path to avoid ZipSlip issues.All double '/', '.' and '..' path entries are resolved and removed. The returned path will have a '/' at the end when the input path has a '/' at the end. A leading '/' is stripped. An empty string is unmodified.
- Parameters:
path
- ZipEntry path. Must not benull
.- Returns:
- Cleansed ZipEntry path.
- Throws:
UncheckedIOException
- If the entry used '..' relative paths to back up past the start of the path.
-
isCompromised
-