org.apache.commons.compress.archivers.zip.ZipFile.closeQuietly()方法的使用及代码示例

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

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

ZipFile.closeQuietly介绍

[英]close a zipfile quietly; throw no io fault, do nothing on a null parameter
[中]轻轻地合上拉链;不抛出io错误,对空参数不执行任何操作

代码示例

代码示例来源:origin: jeremylong/DependencyCheck

LOGGER.debug("Unable to unzip zip file '{}'", dependency.getFilePath(), ex);
} finally {
  ZipFile.closeQuietly(zip);

代码示例来源:origin: com.taobao.android/dex_patch

public static List<String> listZipEntries(File zipFile) {
  List<String> list = new ArrayList<String>();
  ZipFile zip;
  try {
    zip = new ZipFile(zipFile);
    Enumeration<ZipArchiveEntry> en = zip.getEntries();
    ZipArchiveEntry ze = null;
    while (en.hasMoreElements()) {
      ze = en.nextElement();
      String name = ze.getName();
      list.add(name);
    }
    if (null != zip) ZipFile.closeQuietly(zip);
  } catch (IOException e) {
  }
  return list;
}

代码示例来源:origin: com.atlassian.jira/jira-core

ZipFile.closeQuietly(file);

代码示例来源:origin: com.taobao.android/dex_patch

fos.close();
  if (null != zip) ZipFile.closeQuietly(zip);
} catch (IOException e) {
  e.printStackTrace();

代码示例来源:origin: org.overlord.sramp/s-ramp-atom

ZipFile.closeQuietly(zipFile);

代码示例来源:origin: com.atlassian.jira/jira-core

ZipFile.closeQuietly(file);

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.solr.core

ZipFile.closeQuietly(archive);

代码示例来源:origin: com.atlassian.jira/jira-core

private boolean validIndexZipFile(final String zipFile)
  {
    // We want a zip file with an index for ao and ofbiz data.
    try
    {
      final ZipFile file = new ZipFile(zipFile);
      try
      {
        final ZipArchiveEntry ofbizXML = file.getEntry("entities.xml");
        final ZipArchiveEntry aoXML = file.getEntry("activeobjects.xml");
        return ofbizXML != null && aoXML != null;
      }
      finally
      {
        ZipFile.closeQuietly(file);
      }
    }
    catch (IOException e)
    {
      LOG.debug("Can't access zip file '" + zipFile+ "'");
      return false;
    }
  }
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.solr.core

ZipFile.closeQuietly(archive);

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

ZipFile.closeQuietly(archive);

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

ZipFile.closeQuietly(archive);

代码示例来源:origin: com.atlassian.jira/jira-core

ZipFile.closeQuietly(file);

代码示例来源:origin: org.owasp/dependency-check-core

LOGGER.debug("Unable to unzip zip file '{}'", dependency.getFilePath(), ex);
} finally {
  ZipFile.closeQuietly(zip);

代码示例来源:origin: org.apache.ant/ant-compress

ZipFile.closeQuietly(zf);

代码示例来源:origin: com.android.tools/repository

ZipFile.closeQuietly(zipFile);

相关文章