
net.lingala.zip4j.model.enums.CompressionMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zip4j Show documentation
Show all versions of zip4j Show documentation
An open source java library to handle zip files
package net.lingala.zip4j.model.enums;
import net.lingala.zip4j.exception.ZipException;
public enum CompressionMethod {
STORE(0),
DEFLATE(8),
AES_INTERNAL_ONLY(99);
private int code;
CompressionMethod(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public static CompressionMethod getCompressionMethodFromCode(int code) throws ZipException {
for (CompressionMethod compressionMethod : values()) {
if (compressionMethod.getCode() == code) {
return compressionMethod;
}
}
throw new ZipException("Unknown compression method", ZipException.Type.UNKNOWN_COMPRESSION_METHOD);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy