org.zeroturnaround.zip.ZipUtil.unwrap()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(169)

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

ZipUtil.unwrap介绍

[英]Unwraps a ZIP file to the given directory shaving of root dir. If there are multiple root dirs or entries in the root of zip, ZipException is thrown.

The output directory must not be a file.
[中]将ZIP文件展开到给定的根目录。如果zip的根目录中有多个根目录或条目,则会抛出ZipException。
输出目录不能是文件。

代码示例

代码示例来源:origin: zeroturnaround/zt-zip

/**
 * Unwraps a ZIP file to the given directory shaving of root dir.
 * If there are multiple root dirs or entries in the root of zip,
 * ZipException is thrown.
 * <p>
 * The output directory must not be a file.
 *
 * @param zip
 *          input ZIP file.
 * @param outputDir
 *          output directory (created automatically if not found).
 */
public static void unwrap(File zip, final File outputDir) {
 unwrap(zip, outputDir, IdentityNameMapper.INSTANCE);
}

代码示例来源:origin: zeroturnaround/zt-zip

/**
 * Unwraps a ZIP file to the given directory shaving of root dir.
 * If there are multiple root dirs or entries in the root of zip,
 * ZipException is thrown.
 * <p>
 * The output directory must not be a file.
 *
 * @param is
 *          inputstream for ZIP file.
 * @param outputDir
 *          output directory (created automatically if not found).
 */
public static void unwrap(InputStream is, File outputDir) {
 unwrap(is, outputDir, IdentityNameMapper.INSTANCE);
}

代码示例来源:origin: jphp-group/jphp

@Signature
public static void unwrap(PZipFile zip, File outputDir, @Nullable Invoker callback) throws FileNotFoundException {
  if (!zip.zipFile.isFile()) {
    throw new FileNotFoundException(zip.zipFile.getPath() + " not found");
  }
  NameMapper mapper = invokerToNameMapper(callback);
  ZipUtil.unwrap(zip.zipFile, outputDir, mapper);
}

代码示例来源:origin: org.zeroturnaround/zt-zip

/**
 * Unwraps a ZIP file to the given directory shaving of root dir.
 * If there are multiple root dirs or entries in the root of zip,
 * ZipException is thrown.
 * <p>
 * The output directory must not be a file.
 *
 * @param is
 *          inputstream for ZIP file.
 * @param outputDir
 *          output directory (created automatically if not found).
 */
public static void unwrap(InputStream is, File outputDir) {
 unwrap(is, outputDir, IdentityNameMapper.INSTANCE);
}

代码示例来源:origin: org.zeroturnaround/zt-zip

/**
 * Unwraps a ZIP file to the given directory shaving of root dir.
 * If there are multiple root dirs or entries in the root of zip,
 * ZipException is thrown.
 * <p>
 * The output directory must not be a file.
 *
 * @param zip
 *          input ZIP file.
 * @param outputDir
 *          output directory (created automatically if not found).
 */
public static void unwrap(File zip, final File outputDir) {
 unwrap(zip, outputDir, IdentityNameMapper.INSTANCE);
}

相关文章