本文整理了Java中org.apache.tools.zip.ZipFile.close()
方法的一些代码示例,展示了ZipFile.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipFile.close()
方法的具体详情如下:
包路径:org.apache.tools.zip.ZipFile
类名称:ZipFile
方法名:close
[英]Closes the archive.
[中]关闭档案。
代码示例来源:origin: org.apache.ant/ant
/**
* close a zipfile quietly; throw no io fault, do nothing
* on a null parameter
* @param zipfile file to close, can be null
*/
public static void closeQuietly(final ZipFile zipfile) {
if (zipfile != null) {
try {
zipfile.close();
} catch (final IOException e) {
//ignore
}
}
}
代码示例来源:origin: org.apache.ant/ant
/**
* Ensures that the close method of this zipfile is called when
* there are no more references to it.
* @see #close()
*/
@Override
protected void finalize() throws Throwable {
try {
if (!closed) {
System.err.printf("Cleaning up unclosed %s for archive %s%n",
getClass().getSimpleName(), archiveName);
close();
}
} finally {
super.finalize();
}
}
代码示例来源:origin: org.apache.ant/ant
public void close() throws IOException {
FileUtils.close(in);
z.close();
}
protected void finalize() throws Throwable {
代码示例来源:origin: jenkinsci/jenkins
zip.close();
代码示例来源:origin: org.apache.ant/ant
ZipEntry ze = z.getEntry(getName());
if (ze == null) {
z.close();
throw new BuildException("no entry " + getName() + " in "
+ getArchive());
代码示例来源:origin: org.apache.ant/ant
zf.close();
代码示例来源:origin: sanluan/PublicCMS
zipFile.close();
代码示例来源:origin: sanluan/PublicCMS
zipFile.close();
代码示例来源:origin: gradle.plugin.com.bettycc.umengauto/core
System.out.println("package :" + apkName + " success, take time " + (takeTime) / 1000 + "s " + ms + "ms");
file.close();
long totalTakeTime = System.currentTimeMillis() - start;
long ms = totalTakeTime % 1000;
代码示例来源:origin: qq53182347/liugh-parent
try {
if(null!=zipFile){
zipFile.close();
代码示例来源:origin: com.github.javahaohao/utils
public static boolean unZipWithoutOverWrite(String unZipFileName,
String destFileName) {
File unzipFile = new File(unZipFileName);
if (StringUtils.isBlank(destFileName) || destFileName.trim().length() == 0)
destFileName = unzipFile.getParent();
File destFile;
ZipFile zipFile = null;
try {
zipFile = new ZipFile(unzipFile, "GBK");
for (Enumeration entries = zipFile.getEntries(); entries
.hasMoreElements();) {
ZipEntry entry = (ZipEntry) entries.nextElement();
destFile = new File(destFileName, entry.getName());
unZipFile(destFile, zipFile, entry, false); // 执行解压
}
} catch (Exception e) {
log.error("解压ZIP文件异常", e);
return false;
} finally {
try {
assert zipFile != null;
zipFile.close();
} catch (Exception e) {
log.error("异常", e);
}
}
return true;
}
代码示例来源:origin: com.github.javahaohao/utils
try {
assert zipFile != null;
zipFile.close();
} catch (Exception e) {
log.error("异常", e);
代码示例来源:origin: GaoFeiGit/xutils
zf.close();
} catch (IOException ioe) {
ioe.printStackTrace();
代码示例来源:origin: com.github.tianjing/tgtools.core
zf.close();
代码示例来源:origin: net.mingsoft/ms-util
zipFile.close();
zipFile.close();
代码示例来源:origin: qq53182347/liugh-parent
zipFile.close();
return true;
} catch (Exception e) {
代码示例来源:origin: GaoFeiGit/xutils
zf.close();
} catch (IOException ioe) {
ioe.printStackTrace();
代码示例来源:origin: org.gradle/gradle-core
zip.close();
代码示例来源:origin: org.kantega.openaksess/openaksess-core
zipFile.close();
} finally {
temp.delete();
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
zip.close();
内容来源于网络,如有侵权,请联系作者删除!