本文整理了Java中org.apache.commons.compress.archivers.zip.ZipFile.close()
方法的一些代码示例,展示了ZipFile.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipFile.close()
方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipFile
类名称:ZipFile
方法名:close
[英]Closes the archive.
[中]关闭档案。
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public void close() throws IOException {
if(zipArchive != null) {
zipArchive.close();
}
zipArchive = null;
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* 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.println("Cleaning up unclosed ZipFile for archive "
+ archiveName);
close();
}
} finally {
super.finalize();
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public void close() throws IOException {
if(!closed) {
zipFile.close();
if (!tmpFile.delete()) {
LOG.log(POILogger.WARN, tmpFile.getAbsolutePath()+" can't be removed (or was already removed.");
}
}
closed = true;
}
代码示例来源:origin: plutext/docx4j
zf.close();
} catch (IOException exc) {
exc.printStackTrace();
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
@Override
public void close()
throws IOException
{
zipFile.close();
}
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
@Override
public void close()
throws IOException
{
try
{
urlClassLoader.close();
}
finally
{
try
{
zipFile.close();
} finally
{
jarFile.close();
}
}
}
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
zf.close();
代码示例来源:origin: apache/tika
protected String readArchiveText(InputStream inputStream) throws IOException {
Path tempFile = writeTemporaryArchiveFile(inputStream, "zip");
ZipFile zip = new ZipFile(tempFile.toFile());
zip.getEntry(UnpackerResource.TEXT_FILENAME);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
IOUtils.copy(zip.getInputStream(zip.getEntry(UnpackerResource.TEXT_FILENAME)), bos);
zip.close();
Files.delete(tempFile);
return bos.toString(UTF_8.name());
}
代码示例来源:origin: apache/tika
protected Map<String, String> readZipArchive(InputStream inputStream) throws IOException {
Map<String, String> data = new HashMap<String, String>();
Path tempFile = writeTemporaryArchiveFile(inputStream, "zip");
ZipFile zip = new ZipFile(tempFile.toFile());
Enumeration<ZipArchiveEntry> entries = zip.getEntries();
while (entries.hasMoreElements()) {
ZipArchiveEntry entry = entries.nextElement();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
IOUtils.copy(zip.getInputStream(entry), bos);
data.put(entry.getName(), DigestUtils.md5Hex(bos.toByteArray()));
}
zip.close();
Files.delete(tempFile);
return data;
}
代码示例来源:origin: io.takari/takari-archiver
@Override
protected void finalize() throws Throwable {
super.close();
}
};
代码示例来源:origin: edu.jhu.hlt/acute
@Override
public void close() throws IOException {
this.zf.close();
}
}
代码示例来源:origin: org.rauschig/jarchivelib
private void closeFile() {
try {
file.close();
} catch (IOException e) {
// close quietly
}
}
代码示例来源:origin: thrau/jarchivelib
private void closeFile() {
try {
file.close();
} catch (IOException e) {
// close quietly
}
}
代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.common
@Override
public void close() throws IOException {
zipFile.close();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-xar-model
@Override
public void close() throws IOException
{
this.zipFile.close();
}
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
zipFile.close();
zipFile = null;
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public void close() throws IOException
{
super.close();
file.close();
}
};
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
zf.close();
zf = null;
代码示例来源:origin: apache/tika
zip.close();
} catch (IOException e) {
代码示例来源:origin: org.apache.ant/ant-compress
@Override
public void close() throws IOException {
FileUtils.close(in);
z.close();
}
@Override
内容来源于网络,如有侵权,请联系作者删除!