gpt4 book ai didi

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

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

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

ZipParameters.setIncludeRootFolder介绍

暂无

代码示例

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

ZipParameters parameters = new ZipParameters();
parameters.setIncludeRootFolder(true);
zipFile.removeFile(fh);
zipFile.addFolder(new File(tempdir.toFile(), "META-INF"), parameters);

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

_parameters.setCompressionMethod(Zip4jConstants.COMP_STORE);
_parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_FASTEST);
_parameters.setIncludeRootFolder(false);
ArrayList<File> _files = new ArrayList<File>();
for(int j=1;j<5;j++){
  parameters.setCompressionMethod(Zip4jConstants.COMP_STORE);
  parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_FASTEST);
  parameters.setIncludeRootFolder(false);
  ArrayList<File> files = new ArrayList<File>();
  for(int j=1;j<5;j++){

代码示例来源:origin: org.apache.apex/apex-engine

public static void createAppPackageFile(File fileToBeCreated, File directory) throws ZipException
{
 ZipFile zipFile = new ZipFile(fileToBeCreated);
 ZipParameters params = new ZipParameters();
 params.setIncludeRootFolder(false);
 zipFile.addFolder(directory, params);
}

代码示例来源:origin: HypixelDev/ResourcePackConverter

@Override
public void finish() throws IOException {
  try {
    System.out.println("  Zipping working directory");
    ZipFile zipFile = new ZipFile(getConvertedZipPath().toFile());
    ZipParameters parameters = new ZipParameters();
    parameters.setIncludeRootFolder(false);
    zipFile.createZipFileFromFolder(pack.getWorkingPath().toFile(), parameters, false, 65536);
  } catch (ZipException e) {
    Util.propagate(e);
  }
  System.out.println("  Deleting working directory");
  Util.deleteDirectoryAndContents(pack.getWorkingPath());
}

代码示例来源:origin: dwatling/apk-decompiler

private void generateZipFile() {
  try {
    File outputFile = new File(this.workFolder.getName() + ".zip");
    if (outputFile.exists()) {
      Logger.info(outputFile.getAbsolutePath() + " already exists. Deleting.");
      outputFile.delete();
    }
    ZipFile output = new net.lingala.zip4j.core.ZipFile(outputFile);
    Logger.info("Generating " + output.getFile().getAbsolutePath());
    ZipParameters params = new ZipParameters();
    params.setIncludeRootFolder(false);
    params.setRootFolderInZip("");
    output.addFolder(this.workFolder.getAbsolutePath() + File.separator + "apktool", params);
    params.setRootFolderInZip("classes");
    output.addFolder(this.workFolder.getAbsolutePath() + File.separator + "classes", params);
  } catch (Throwable t) {
    Logger.error("Unable to generate final zip file.", t);
  }
}

代码示例来源:origin: org.integratedmodelling/klab-common

/**
 * Create a zip with the passed directory's contents in it. The directory will be the top entry
 * in the file if storeDirectory is true.
 * 
 * @param zipFile
 * @param directory
 * @throws KlabException
 */
public static void zip(File zipFile, File directory, boolean storeDirectory, boolean readHiddenFiles)
    throws KlabException {
  // dest = buildDestinationZipFilePath(srcFile, dest);
  ZipParameters parameters = new ZipParameters();
  // parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); //
  // parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL); //
  parameters.setIncludeRootFolder(storeDirectory);
  // parameters.setReadHiddenFiles(readHiddenFiles);
  try {
    ZipFile zipF = new ZipFile(zipFile);
    zipF.addFolder(directory, parameters);
  } catch (ZipException e) {
    throw new KlabIOException(e);
  }
}

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