Package net.fabricmc.loom.util
Class ZipUtils
java.lang.Object
net.fabricmc.loom.util.ZipUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidstatic voidstatic booleanstatic voiddeleteIfExists(Path zip, String path) static booleanstatic voidstatic voidstatic inttransform(Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) static inttransform(Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<byte[]>> transforms) static intstatic inttransformAsync(Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) static inttransformAsync(Path zip, Supplier<ExecutorService> executorSupplier, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) static inttransformAsync(Path zip, Supplier<ExecutorService> executorSupplier, Map<String, ZipUtils.UnsafeUnaryOperator<byte[]>> transforms) static inttransformAsync(Path zip, Supplier<ExecutorService> executorSupplier, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) static inttransformAsync(Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) static <T> voidtransformJson(Class<T> typeOfT, Path zip, String path, ZipUtils.UnsafeUnaryOperator<T> transformer) static <T> inttransformJson(Class<T> typeOfT, Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<T>>> transforms) static <T> inttransformJson(Class<T> typeOfT, Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<T>> transforms) static <T> inttransformJson(Class<T> typeOfT, Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<T>>> transforms) static <T> inttransformMapped(Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<T>> transforms, Function<byte[], T> deserializer, Function<T, byte[]> serializer) static inttransformString(Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<String>>> transforms) static inttransformString(Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<String>> transforms) static inttransformString(Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<String>>> transforms) static byte[]static voidstatic <T> TunpackGson(Path zip, String path, Class<T> clazz) static <T> @Nullable TunpackGsonNullable(Path zip, String path, Class<T> clazz) static <T> TunpackJson(Path zip, String path, Class<T> clazz) static byte @Nullable []unpackNullable(Path zip, String path)
-
Constructor Details
-
ZipUtils
public ZipUtils()
-
-
Method Details
-
isZip
- Throws:
IOException
-
contains
-
unpackAll
- Throws:
IOException
-
unpackNullable
- Throws:
IOException
-
unpack
- Throws:
IOException
-
unpackGson
- Throws:
IOException
-
unpackGsonNullable
public static <T> @Nullable T unpackGsonNullable(Path zip, String path, Class<T> clazz) throws IOException - Throws:
IOException
-
unpackJson
- Throws:
IOException
-
pack
- Throws:
IOException
-
add
- Throws:
IOException
-
add
- Throws:
IOException
-
add
- Throws:
IOException
-
replace
- Throws:
IOException
-
deleteIfExists
- Throws:
IOException
-
transformString
public static int transformString(Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<String>>> transforms) throws IOException- Throws:
IOException
-
transformString
public static int transformString(Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<String>>> transforms) throws IOException- Throws:
IOException
-
transformString
public static int transformString(Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<String>> transforms) throws IOException- Throws:
IOException
-
transformJson
public static <T> int transformJson(Class<T> typeOfT, Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<T>>> transforms) throws IOException- Throws:
IOException
-
transformJson
public static <T> int transformJson(Class<T> typeOfT, Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<T>>> transforms) throws IOException- Throws:
IOException
-
transformJson
public static <T> int transformJson(Class<T> typeOfT, Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<T>> transforms) throws IOException- Throws:
IOException
-
transformJson
public static <T> void transformJson(Class<T> typeOfT, Path zip, String path, ZipUtils.UnsafeUnaryOperator<T> transformer) throws IOException - Throws:
IOException
-
transform
public static int transform(Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) throws IOException- Throws:
IOException
-
transform
public static int transform(Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) throws IOException- Throws:
IOException
-
transformMapped
public static <T> int transformMapped(Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<T>> transforms, Function<byte[], throws IOExceptionT> deserializer, Function<T, byte[]> serializer) - Throws:
IOException
-
transform
public static int transform(Path zip, Map<String, ZipUtils.UnsafeUnaryOperator<byte[]>> transforms) throws IOException- Throws:
IOException
-
transformAsync
public static int transformAsync(Path zip, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) throws IOException- Throws:
IOException
-
transformAsync
public static int transformAsync(Path zip, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) throws IOException- Throws:
IOException
-
transformAsync
public static int transformAsync(Path zip, Supplier<ExecutorService> executorSupplier, Collection<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) throws IOException- Throws:
IOException
-
transformAsync
public static int transformAsync(Path zip, Supplier<ExecutorService> executorSupplier, Stream<Pair<String, ZipUtils.UnsafeUnaryOperator<byte[]>>> transforms) throws IOException- Throws:
IOException
-
transformAsync
public static int transformAsync(Path zip, Supplier<ExecutorService> executorSupplier, Map<String, ZipUtils.UnsafeUnaryOperator<byte[]>> transforms) throws IOException- Throws:
IOException
-