org.apache.hadoop.fs.FileUtil.unZip()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(178)

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

FileUtil.unZip介绍

[英]Given a File input it will unzip the file in a the unzip directory passed as the second parameter
[中]给定一个文件输入,它将在作为第二个参数传递的解压目录中解压该文件

代码示例

代码示例来源:origin: apache/ignite

RunJar.unJar(archiveFile, dstPath);
else if (archiveNameLC.endsWith(FilePageStoreManager.ZIP_SUFFIX))
  FileUtil.unZip(archiveFile, dstPath);
else if (archiveNameLC.endsWith(".tar.gz") ||
  archiveNameLC.endsWith(".tgz") ||

代码示例来源:origin: apache/attic-mrunit

/**
 * Extract an archive to the temp directory.
 * Code borrowed from Hadoop's TrackerDistributedCacheManager
 *
 * @param cacheArchive the cache archive to extract
 * @param tmpDir root location of temp directory
 * @return the path to the extracted archive
 * @throws IOException
 */
public static Path extractArchiveToTemp(Path cacheArchive, File tmpDir) throws IOException {
 String tmpArchive = cacheArchive.getName().toLowerCase();
 File srcFile = new File(cacheArchive.toString());
 File destDir = new File(tmpDir, srcFile.getName());
 LOG.debug(String.format("Extracting %s to %s",
      srcFile.toString(), destDir.toString()));
 if (tmpArchive.endsWith(".jar")) {
  RunJar.unJar(srcFile, destDir);
 } else if (tmpArchive.endsWith(".zip")) {
  FileUtil.unZip(srcFile, destDir);
 } else if (isTarFile(tmpArchive)) {
  FileUtil.unTar(srcFile, destDir);
 } else {
  LOG.warn(String.format(
    "Cache file %s specified as archive, but not valid extension.",
    srcFile.toString()));
  return cacheArchive;
 }
 return new Path(destDir.toString());
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapred

RunJar.unJar(srcFile, destDir);
} else if (tmpArchive.endsWith(".zip")) {
 FileUtil.unZip(srcFile, destDir);
} else if (isTarFile(tmpArchive)) {
 FileUtil.unTar(srcFile, destDir);

代码示例来源:origin: com.facebook.hadoop/hadoop-core

RunJar.unJar(srcFile, destDir);
} else if (tmpArchive.endsWith(".zip")) {
 FileUtil.unZip(srcFile, destDir);
} else if (isTarFile(tmpArchive)) {
 FileUtil.unTar(srcFile, destDir);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

RunJar.unJar(localrsrc, dst);
} else if (lowerDst.endsWith(".zip")) {
 FileUtil.unZip(localrsrc, dst);
} else if (lowerDst.endsWith(".tar.gz") ||
      lowerDst.endsWith(".tgz") ||
 LOG.warn("Treating [" + localrsrc + "] as an archive even though it " +
     "was specified as PATTERN");
 FileUtil.unZip(localrsrc, dst);
} else if (lowerDst.endsWith(".tar.gz") ||
      lowerDst.endsWith(".tgz") ||

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

RunJar.unJar(inputStream, dst, RunJar.MATCH_ANY);
} else if (lowerDst.endsWith(".zip")) {
 FileUtil.unZip(inputStream, dst);
} else if (lowerDst.endsWith(".tar.gz") ||
  lowerDst.endsWith(".tgz") ||
 LOG.warn("Treating [" + source + "] as an archive even though it " +
   "was specified as PATTERN");
 FileUtil.unZip(inputStream, dst);
} else if (lowerDst.endsWith(".tar.gz") ||
  lowerDst.endsWith(".tgz") ||

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

RunJar.unJar(localrsrc, dst);
} else if (lowerDst.endsWith(".zip")) {
 FileUtil.unZip(localrsrc, dst);
} else if (lowerDst.endsWith(".tar.gz") ||
      lowerDst.endsWith(".tgz") ||
 LOG.warn("Treating [" + localrsrc + "] as an archive even though it " +
     "was specified as PATTERN");
 FileUtil.unZip(localrsrc, dst);
} else if (lowerDst.endsWith(".tar.gz") ||
      lowerDst.endsWith(".tgz") ||

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

RunJar.unJar(srcFile, destDir);
} else if (tmpArchive.endsWith(".zip")) {
 FileUtil.unZip(srcFile, destDir);
} else if (isTarFile(tmpArchive)) {
 FileUtil.unTar(srcFile, destDir);

代码示例来源:origin: ch.cern.hadoop/hadoop-common

FileUtil.unZip(simpleZip, tmp);
assertTrue(regularFile.exists());
try {
 FileUtil.unZip(simpleZip, regularFile);
 assertTrue("An IOException expected.", false);
} catch (IOException ioe) {

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

FileUtil.unZip(simpleZip, tmp);
assertTrue(regularFile.exists());
try {
 FileUtil.unZip(simpleZip, regularFile);
 assertTrue("An IOException expected.", false);
} catch (IOException ioe) {

相关文章