gpt4 book ai didi

net.lingala.zip4j.model.ZipParameters.setEncryptionMethod()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 17:28:40 25 4
gpt4 key购买 nike

本文整理了Java中net.lingala.zip4j.model.ZipParameters.setEncryptionMethod()方法的一些代码示例,展示了ZipParameters.setEncryptionMethod()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipParameters.setEncryptionMethod()方法的具体详情如下:
包路径:net.lingala.zip4j.model.ZipParameters
类名称:ZipParameters
方法名:setEncryptionMethod

ZipParameters.setEncryptionMethod介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public void zipFileWithPassword(String fileToZipPath,String password,String zippedFilePath) throws ZipException
{
  ZipFile zipFile=new ZipFile(zippedFilePath);
  ZipParameters parameters=new ZipParameters();
  parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
  parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
  parameters.setEncryptFiles(true);
  parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);
  parameters.setPassword(password);
  File fileToZip=new File(fileToZipPath);
  log(Severity.INFO,"Creating a ZIP file: %s",fileToZipPath);
  zipFile.addFile(fileToZip,parameters);
}

代码示例来源:origin: stackoverflow.com

parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);

代码示例来源:origin: stackoverflow.com

zipParams.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
zipParams.setEncryptFiles(true);
zipParams.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);
zipParams.setPassword(pass);
zipParams.setSourceExternalStream(true);

代码示例来源:origin: stackoverflow.com

parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);

代码示例来源:origin: stackoverflow.com

parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
parameters.setPassword(password);

代码示例来源:origin: jclehner/rxdroid

zp.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
zp.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
zp.setEncryptFiles(true);

代码示例来源:origin: Nepxion/Skeleton

parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD); // 加密方式  
parameters.setPassword(password.toCharArray());

代码示例来源:origin: stackoverflow.com

zipParameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_ULTRA);
zipParameters.setEncryptFiles(true);
zipParameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
zipParameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
zipParameters.setPassword(password);

代码示例来源:origin: SpringCloud/spring-cloud-codegen

parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD); // 加密方式  
parameters.setPassword(password.toCharArray());

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

parameters.setEncryptFiles(true);
parameters.setPassword(password);
parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD); // AES is good but poorly supported by zip UIs
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);

代码示例来源:origin: stackoverflow.com

ZipParameters parameters = new ZipParameters();
     parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); // set compression method to deflate compression
//DEFLATE_LEVEL_FASTEST     - Lowest compression level but higher speed of compression
     //DEFLATE_LEVEL_FAST        - Low compression level but higher speed of compression
     //DEFLATE_LEVEL_NORMAL  - Optimal balance between compression level/speed
     //DEFLATE_LEVEL_MAXIMUM     - High compression level with a compromise of speed
     //DEFLATE_LEVEL_ULTRA       - Highest compression level but low speed
     parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
     //Set the encryption flag to true
     parameters.setEncryptFiles(true);
     //Set the encryption method to AES Zip Encryption
     parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
     //AES_STRENGTH_128 - For both encryption and decryption
     //AES_STRENGTH_192 - For decryption only
     //AES_STRENGTH_256 - For both encryption and decryption
     //Key strength 192 cannot be used for encryption. But if a zip file already has a
     //file encrypted with key strength of 192, then Zip4j can decrypt this file
     parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);

代码示例来源:origin: com.jalalkiswani/jk-util

/**
 * Compress.
 *
 * @param fileName
 *            the file name
 * @param compressedFileName
 *            the compressed file name
 * @param password
 *            the password
 */
public static void compress(String fileName, String compressedFileName, String password) {
  try {
    ZipParameters zipParameters = new ZipParameters();
    zipParameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
    zipParameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_ULTRA);
    if (password != null) {
      zipParameters.setEncryptFiles(true);
      zipParameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
      zipParameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
      zipParameters.setPassword(password);
    }
    String destinationZipFilePath = compressedFileName;
    ZipFile zipFile = new ZipFile(destinationZipFilePath);
    zipFile.addFile(new File(fileName), zipParameters);
  } catch (ZipException e) {
    JKExceptionUtil.handle(e);
  }
}

代码示例来源:origin: MCMrARM/revolution-irc

if (password != null) {
  params.setEncryptFiles(true);
  params.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
  params.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
  params.setPassword(password);

代码示例来源:origin: net.lingala.zip4j/zip4j

if (sourceFile.isDirectory()) {
  this.zipParameters.setEncryptFiles(false);
  this.zipParameters.setEncryptionMethod(-1);
  this.zipParameters.setCompressionMethod(Zip4jConstants.COMP_STORE);
    this.zipParameters.getFileNameInZip().endsWith("\\")) {
  this.zipParameters.setEncryptFiles(false);
  this.zipParameters.setEncryptionMethod(-1);
  this.zipParameters.setCompressionMethod(Zip4jConstants.COMP_STORE);

代码示例来源:origin: net.lingala.zip4j/zip4j

parameters.setEncryptionMethod(-1);

代码示例来源:origin: com.github.axet/zip4j

parameters.setEncryptionMethod(-1);

代码示例来源:origin: com.github.axet/zip4j

if (sourceFile.isDirectory()) {
  this.zipParameters.setEncryptFiles(false);
  this.zipParameters.setEncryptionMethod(-1);
  this.zipParameters.setCompressionMethod(Zip4jConstants.COMP_STORE);
    this.zipParameters.getFileNameInZip().endsWith("\\")) {
  this.zipParameters.setEncryptFiles(false);
  this.zipParameters.setEncryptionMethod(-1);
  this.zipParameters.setCompressionMethod(Zip4jConstants.COMP_STORE);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com