Package net.minecraft.util
Class ZipCompressor
java.lang.Object
net.minecraft.util.ZipCompressor
- All Implemented Interfaces:
Closeable
,AutoCloseable
A ZIP compressor builds up a ZIP file. It completes the ZIP file when it is
closed. All its methods and constructors throw
UncheckedIOException
when an I/O error occurs.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Copies asource
file to thetarget
path within the ZIP.void
Copies thesource
file or directory to the root of the ZIP.void
Writes thecontent
, in UTF-8 encoding, to thetarget
path within the ZIP.
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGER
Lnet/minecraft/util/ZipCompressor;LOGGER:Lorg/slf4j/Logger;
intermediary field_33864
Lnet/minecraft/class_6397;field_33864:Lorg/slf4j/Logger;
official a
Laxr;a:Lorg/slf4j/Logger;
-
file
- Mappings:
Namespace Name Mixin selector named file
Lnet/minecraft/util/ZipCompressor;file:Ljava/nio/file/Path;
intermediary field_33865
Lnet/minecraft/class_6397;field_33865:Ljava/nio/file/Path;
official b
Laxr;b:Ljava/nio/file/Path;
-
temp
- Mappings:
Namespace Name Mixin selector named temp
Lnet/minecraft/util/ZipCompressor;temp:Ljava/nio/file/Path;
intermediary field_33866
Lnet/minecraft/class_6397;field_33866:Ljava/nio/file/Path;
official c
Laxr;c:Ljava/nio/file/Path;
-
zip
- Mappings:
Namespace Name Mixin selector named zip
Lnet/minecraft/util/ZipCompressor;zip:Ljava/nio/file/FileSystem;
intermediary field_33867
Lnet/minecraft/class_6397;field_33867:Ljava/nio/file/FileSystem;
official d
Laxr;d:Ljava/nio/file/FileSystem;
-
-
Constructor Details
-
ZipCompressor
Creates a ZIP compressor.- Parameters:
file
- the path of the ZIP file- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/util/ZipCompressor;<init>(Ljava/nio/file/Path;)V
intermediary <init>
Lnet/minecraft/class_6397;<init>(Ljava/nio/file/Path;)V
official <init>
Laxr;<init>(Ljava/nio/file/Path;)V
-
-
Method Details
-
write
Writes thecontent
, in UTF-8 encoding, to thetarget
path within the ZIP.The
target
should be a relative path, as it will be resolved against the root of the ZIP.- Parameters:
target
- the target path in the ZIPcontent
- the file content to write in UTF-8- Mappings:
Namespace Name Mixin selector named write
Lnet/minecraft/util/ZipCompressor;write(Ljava/nio/file/Path;Ljava/lang/String;)V
intermediary method_37163
Lnet/minecraft/class_6397;method_37163(Ljava/nio/file/Path;Ljava/lang/String;)V
official a
Laxr;a(Ljava/nio/file/Path;Ljava/lang/String;)V
-
copy
Copies asource
file to thetarget
path within the ZIP.If the
source
is a directory, then an empty directory would be copied. Thetarget
should be a relative path, as it will be resolved against the root of the ZIP.- Parameters:
target
- the target path in the ZIPsource
- the source file to copy- Mappings:
Namespace Name Mixin selector named copy
Lnet/minecraft/util/ZipCompressor;copy(Ljava/nio/file/Path;Ljava/io/File;)V
intermediary method_37162
Lnet/minecraft/class_6397;method_37162(Ljava/nio/file/Path;Ljava/io/File;)V
official a
Laxr;a(Ljava/nio/file/Path;Ljava/io/File;)V
-
copyAll
Copies thesource
file or directory to the root of the ZIP.- Parameters:
source
- the source file or directory to copy- Mappings:
Namespace Name Mixin selector named copyAll
Lnet/minecraft/util/ZipCompressor;copyAll(Ljava/nio/file/Path;)V
intermediary method_37161
Lnet/minecraft/class_6397;method_37161(Ljava/nio/file/Path;)V
official a
Laxr;a(Ljava/nio/file/Path;)V
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-