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

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

本文整理了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

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

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

  1. public static List<String> listZipEntries(File zipFile) {
  2. List<String> list = new ArrayList<String>();
  3. ZipFile zip;
  4. try {
  5. zip = new ZipFile(zipFile);
  6. Enumeration<ZipArchiveEntry> en = zip.getEntries();
  7. ZipArchiveEntry ze = null;
  8. while (en.hasMoreElements()) {
  9. ze = en.nextElement();
  10. String name = ze.getName();
  11. list.add(name);
  12. }
  13. if (null != zip) ZipFile.closeQuietly(zip);
  14. } catch (IOException e) {
  15. }
  16. return list;
  17. }

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

  1. ZipFile.closeQuietly(file);

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

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

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

  1. ZipFile.closeQuietly(zipFile);

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

  1. ZipFile.closeQuietly(file);

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

  1. ZipFile.closeQuietly(archive);

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

  1. private boolean validIndexZipFile(final String zipFile)
  2. {
  3. // We want a zip file with an index for ao and ofbiz data.
  4. try
  5. {
  6. final ZipFile file = new ZipFile(zipFile);
  7. try
  8. {
  9. final ZipArchiveEntry ofbizXML = file.getEntry("entities.xml");
  10. final ZipArchiveEntry aoXML = file.getEntry("activeobjects.xml");
  11. return ofbizXML != null && aoXML != null;
  12. }
  13. finally
  14. {
  15. ZipFile.closeQuietly(file);
  16. }
  17. }
  18. catch (IOException e)
  19. {
  20. LOG.debug("Can't access zip file '" + zipFile+ "'");
  21. return false;
  22. }
  23. }
  24. }

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

  1. ZipFile.closeQuietly(archive);

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

  1. ZipFile.closeQuietly(archive);

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

  1. ZipFile.closeQuietly(archive);

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

  1. ZipFile.closeQuietly(file);

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

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

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

  1. ZipFile.closeQuietly(zf);

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

  1. ZipFile.closeQuietly(zipFile);

相关文章