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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidCopies asourcefile to thetargetpath within the ZIP.voidCopies thesourcefile or directory to the root of the ZIP.voidWrites thecontent, in UTF-8 encoding, to thetargetpath within the ZIP.
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official aLaol;a:Lorg/slf4j/Logger;intermediary field_33864Lnet/minecraft/class_6397;field_33864:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/util/ZipCompressor;LOGGER:Lorg/slf4j/Logger;
-
file
- Mappings:
Namespace Name Mixin selector official bLaol;b:Ljava/nio/file/Path;intermediary field_33865Lnet/minecraft/class_6397;field_33865:Ljava/nio/file/Path;named fileLnet/minecraft/util/ZipCompressor;file:Ljava/nio/file/Path;
-
temp
- Mappings:
Namespace Name Mixin selector official cLaol;c:Ljava/nio/file/Path;intermediary field_33866Lnet/minecraft/class_6397;field_33866:Ljava/nio/file/Path;named tempLnet/minecraft/util/ZipCompressor;temp:Ljava/nio/file/Path;
-
zip
- Mappings:
Namespace Name Mixin selector official dLaol;d:Ljava/nio/file/FileSystem;intermediary field_33867Lnet/minecraft/class_6397;field_33867:Ljava/nio/file/FileSystem;named zipLnet/minecraft/util/ZipCompressor;zip:Ljava/nio/file/FileSystem;
-
-
Constructor Details
-
ZipCompressor
Creates a ZIP compressor.- Parameters:
file- the path of the ZIP file- Mappings:
Namespace Name Mixin selector official <init>Laol;<init>(Ljava/nio/file/Path;)Vintermediary <init>Lnet/minecraft/class_6397;<init>(Ljava/nio/file/Path;)Vnamed <init>Lnet/minecraft/util/ZipCompressor;<init>(Ljava/nio/file/Path;)V
-
-
Method Details
-
write
Writes thecontent, in UTF-8 encoding, to thetargetpath within the ZIP.The
targetshould 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 official aLaol;a(Ljava/nio/file/Path;Ljava/lang/String;)Vintermediary method_37163Lnet/minecraft/class_6397;method_37163(Ljava/nio/file/Path;Ljava/lang/String;)Vnamed writeLnet/minecraft/util/ZipCompressor;write(Ljava/nio/file/Path;Ljava/lang/String;)V
-
copy
Copies asourcefile to thetargetpath within the ZIP.If the
sourceis a directory, then an empty directory would be copied. Thetargetshould 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 official aLaol;a(Ljava/nio/file/Path;Ljava/io/File;)Vintermediary method_37162Lnet/minecraft/class_6397;method_37162(Ljava/nio/file/Path;Ljava/io/File;)Vnamed copyLnet/minecraft/util/ZipCompressor;copy(Ljava/nio/file/Path;Ljava/io/File;)V
-
copyAll
Copies thesourcefile or directory to the root of the ZIP.- Parameters:
source- the source file or directory to copy- Mappings:
Namespace Name Mixin selector official aLaol;a(Ljava/nio/file/Path;)Vintermediary method_37161Lnet/minecraft/class_6397;method_37161(Ljava/nio/file/Path;)Vnamed copyAllLnet/minecraft/util/ZipCompressor;copyAll(Ljava/nio/file/Path;)V
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-