Package net.fabricmc.loom.util
Class ZipReprocessorUtil
java.lang.Object
net.fabricmc.loom.util.ZipReprocessorUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendZipEntries(Path file, Map<String, Path> paths) Appends files to a zip file, preserving the existing entry order and time stamps.static voidappendZipEntry(Path file, String path, byte[] data) Appends an entry to a zip file, persevering the existing entry order and time stamps.static voidappendZipEntry(Path file, String path, InputStream data) Appends an entry to a zip file, persevering the existing entry order and time stamps.static booleanisSpecialFile(String zipEntryName) static voidreprocessZip(Path file, boolean reproducibleFileOrder, boolean preserveFileTimestamps) static voidreprocessZip(Path file, boolean reproducibleFileOrder, boolean preserveFileTimestamps, org.gradle.api.tasks.bundling.ZipEntryCompression zipEntryCompression) static voidtransformZipEntry(Path file, String path, ZipUtils.UnsafeUnaryOperator<byte[]> transformer) Transforms a single entry in a zip file, preserving the existing entry order.
-
Method Details
-
isSpecialFile
-
reprocessZip
public static void reprocessZip(Path file, boolean reproducibleFileOrder, boolean preserveFileTimestamps) throws IOException - Throws:
IOException
-
reprocessZip
public static void reprocessZip(Path file, boolean reproducibleFileOrder, boolean preserveFileTimestamps, org.gradle.api.tasks.bundling.ZipEntryCompression zipEntryCompression) throws IOException - Throws:
IOException
-
transformZipEntry
public static void transformZipEntry(Path file, String path, ZipUtils.UnsafeUnaryOperator<byte[]> transformer) throws IOException Transforms a single entry in a zip file, preserving the existing entry order. The transformed entry is written with a constant time stamp to ensure reproducibility. This method should only be used when a reproducible output is required, useZipUtils.transform(Path, java.util.Map)normally.- Throws:
IllegalArgumentException- if the zip file does not contain the specified entryIOException
-
appendZipEntry
Appends an entry to a zip file, persevering the existing entry order and time stamps. The new entry is added with a constant time stamp to ensure reproducibility. This method should only be used when a reproducible output is required, useZipUtils.add(Path, String, byte[])normally.- Throws:
IOException
-
appendZipEntry
Appends an entry to a zip file, persevering the existing entry order and time stamps. The new entry is added with a constant time stamp to ensure reproducibility. This method should only be used when a reproducible output is required, useZipUtils.add(Path, String, byte[])normally.- Throws:
IOException
-
appendZipEntries
Appends files to a zip file, preserving the existing entry order and time stamps. The new entries are appended in map iteration order with constant time stamps to ensure reproducibility. This method should only be used when a reproducible output is required, useZipUtils.add(Path, Iterable)normally.- Throws:
IOException
-