Class ZipReprocessorUtil

java.lang.Object
net.fabricmc.loom.util.ZipReprocessorUtil

public class ZipReprocessorUtil extends Object
  • Method Details

    • isSpecialFile

      public static boolean isSpecialFile(String zipEntryName)
    • 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, use ZipUtils.transform(Path, java.util.Map) normally.
      Throws:
      IllegalArgumentException - if the zip file does not contain the specified entry
      IOException
    • appendZipEntry

      public static void appendZipEntry(Path file, String path, byte[] data) throws IOException
      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, use ZipUtils.add(Path, String, byte[]) normally.
      Throws:
      IOException
    • appendZipEntry

      public static void appendZipEntry(Path file, String path, InputStream data) throws IOException
      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, use ZipUtils.add(Path, String, byte[]) normally.
      Throws:
      IOException
    • appendZipEntries

      public static void appendZipEntries(Path file, Map<String,Path> paths) throws IOException
      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, use ZipUtils.add(Path, Iterable) normally.
      Throws:
      IOException