gpt4 book ai didi

net.lingala.zip4j.core.ZipFile.createZipFile()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 13:32:40 25 4
gpt4 key购买 nike

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

ZipFile.createZipFile介绍

[英]Creates a zip file and adds the source file to the zip file. If the zip file exists then this method throws an exception. Parameters such as compression type, etc can be set in the input parameters
[中]创建zip文件并将源文件添加到zip文件。如果zip文件存在,则此方法引发异常。可以在输入参数中设置压缩类型等参数

代码示例

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

/**
 * Creates a zip file and adds the list of source file(s) to the zip file. If the zip file
 * exists then this method throws an exception. Parameters such as compression type, etc
 * can be set in the input parameters
 * @param sourceFileList - File to be added to the zip file
 * @param parameters - parameters to create the zip file
 * @throws ZipException
 */
public void createZipFile(ArrayList sourceFileList, 
    ZipParameters parameters) throws ZipException {
  createZipFile(sourceFileList, parameters, false, -1);
}

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

/**
 * Creates a zip file and adds the list of source file(s) to the zip file. If the zip file
 * exists then this method throws an exception. Parameters such as compression type, etc
 * can be set in the input parameters
 * @param sourceFileList - File to be added to the zip file
 * @param parameters - parameters to create the zip file
 * @throws ZipException
 */
public void createZipFile(ArrayList sourceFileList, 
    ZipParameters parameters) throws ZipException {
  createZipFile(sourceFileList, parameters, false, -1);
}

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

/**
 * Creates a zip file and adds the source file to the zip file. If the zip file
 * exists then this method throws an exception. Parameters such as compression type, etc
 * can be set in the input parameters
 * @param sourceFile - File to be added to the zip file
 * @param parameters - parameters to create the zip file
 * @throws ZipException
 */
public void createZipFile(File sourceFile, ZipParameters parameters) throws ZipException {
  ArrayList sourceFileList = new ArrayList();
  sourceFileList.add(sourceFile);
  createZipFile(sourceFileList, parameters, false, -1);
}

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

/**
 * Creates a zip file and adds the source file to the zip file. If the zip file
 * exists then this method throws an exception. Parameters such as compression type, etc
 * can be set in the input parameters
 * @param sourceFile - File to be added to the zip file
 * @param parameters - parameters to create the zip file
 * @throws ZipException
 */
public void createZipFile(File sourceFile, ZipParameters parameters) throws ZipException {
  ArrayList sourceFileList = new ArrayList();
  sourceFileList.add(sourceFile);
  createZipFile(sourceFileList, parameters, false, -1);
}

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

/**
 * Creates a zip file and adds the source file to the zip file. If the zip file
 * exists then this method throws an exception. Parameters such as compression type, etc
 * can be set in the input parameters. While the method addFile/addFiles also creates the 
 * zip file if it does not exist, the main functionality of this method is to create a split
 * zip file. To create a split zip file, set the splitArchive parameter to true with a valid
 * splitLength. Split Length has to be more than 65536 bytes
 * @param sourceFile - File to be added to the zip file
 * @param parameters - parameters to create the zip file
 * @param splitArchive - if archive has to be split or not
 * @param splitLength - if archive has to be split, then length in bytes at which it has to be split
 * @throws ZipException
 */
public void createZipFile(File sourceFile, ZipParameters parameters, 
    boolean splitArchive, long splitLength) throws ZipException {
  
  ArrayList sourceFileList = new ArrayList();
  sourceFileList.add(sourceFile);
  createZipFile(sourceFileList, parameters, splitArchive, splitLength);
}

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

/**
 * Creates a zip file and adds the source file to the zip file. If the zip file
 * exists then this method throws an exception. Parameters such as compression type, etc
 * can be set in the input parameters. While the method addFile/addFiles also creates the 
 * zip file if it does not exist, the main functionality of this method is to create a split
 * zip file. To create a split zip file, set the splitArchive parameter to true with a valid
 * splitLength. Split Length has to be more than 65536 bytes
 * @param sourceFile - File to be added to the zip file
 * @param parameters - parameters to create the zip file
 * @param splitArchive - if archive has to be split or not
 * @param splitLength - if archive has to be split, then length in bytes at which it has to be split
 * @throws ZipException
 */
public void createZipFile(File sourceFile, ZipParameters parameters, 
    boolean splitArchive, long splitLength) throws ZipException {
  
  ArrayList sourceFileList = new ArrayList();
  sourceFileList.add(sourceFile);
  createZipFile(sourceFileList, parameters, splitArchive, splitLength);
}

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