- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.close()
方法的一些代码示例,展示了ZipArchiveOutputStream.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiveOutputStream.close()
方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
类名称:ZipArchiveOutputStream
方法名:close
[英]Closes this output stream and releases any system resources associated with the stream.
[中]关闭此输出流并释放与该流关联的所有系统资源。
代码示例来源:origin: plutext/docx4j
public void finishSave() throws Docx4JException {
try {
// Complete the ZIP file
// Don't forget to do this or everything will appear
// to work, but when you open the zip file you'll get an error
// "End-of-central-directory signature not found."
zos.close();
} catch (Exception e ) {
throw new Docx4JException("Failed to put binary part", e);
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
zos.closeArchiveEntry();
zos.close();
fos.close();
zis.close();
代码示例来源:origin: naver/ngrinder
zos.close();
代码示例来源:origin: apache/tika
public void writeTo(Map<String, byte[]> parts, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
ZipArchiveOutputStream zip = new ZipArchiveOutputStream(entityStream);
zip.setMethod(ZipArchiveOutputStream.STORED);
for (Map.Entry<String, byte[]> entry : parts.entrySet()) {
zipStoreBuffer(zip, entry.getKey(), entry.getValue());
}
zip.close();
}
}
代码示例来源:origin: apache/tika
outputStream.close();
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
zipArchiveOutputStream.close();
代码示例来源:origin: USPTO/PatentPublicData
@Override
public void close() throws IOException {
if (outputZip != null){
outputZip.closeArchiveEntry();
outputZip.close();
}
outputZip = null;
}
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
public void writeTo( ZipArchiveOutputStream targetStream ) throws IOException, ExecutionException,
InterruptedException
{
metaInfDir.writeTo( targetStream );
manifest.writeTo( targetStream );
directories.writeTo( targetStream );
synchronousEntries.writeTo( targetStream );
parallelScatterZipCreator.writeTo( targetStream );
long startAt = System.currentTimeMillis();
targetStream.close();
zipCloseElapsed = System.currentTimeMillis() - startAt;
metaInfDir.close();
manifest.close();
directories.close();
synchronousEntries.close();
}
代码示例来源:origin: stackoverflow.com
byte[] zip(byte[] data, String filename) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(bos);
ZipArchiveEntry entry = new ZipArchiveEntry(filename);
entry.setSize(data.length);
zos.putArchiveEntry(entry);
zos.write(data);
zos.closeArchiveEntry();
zos.close();
bos.close();
return bos.toByteArray();
}
代码示例来源:origin: edu.jhu.hlt/acute
@Override
public void close() throws IOException {
this.zout.close();
}
代码示例来源:origin: com.haulmont.reports/reports-core
protected byte[] zipContent(Map<String, Object> stringObjectMap) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(byteArrayOutputStream);
zipOutputStream.setMethod(ZipArchiveOutputStream.STORED);
zipOutputStream.setEncoding(ENCODING);
for (Map.Entry<String, Object> entry : stringObjectMap.entrySet()) {
byte[] data = (byte[]) entry.getValue();
ArchiveEntry archiveEntry = newStoredEntry(entry.getKey(), data);
zipOutputStream.putArchiveEntry(archiveEntry);
zipOutputStream.write(data);
zipOutputStream.closeArchiveEntry();
}
zipOutputStream.close();
return byteArrayOutputStream.toByteArray();
}
代码示例来源:origin: org.alfresco/alfresco-repository
@Override
public void end()
{
try
{
zipStream.close();
}
catch (IOException error)
{
throw new ExporterException("Unexpected error closing zip stream!", error);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-global
public static void writeArchivedLogTailToStream(File logFile, OutputStream outputStream) throws IOException {
if (!logFile.exists()) {
throw new FileNotFoundException();
}
ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(outputStream);
zipOutputStream.setMethod(ZipArchiveOutputStream.DEFLATED);
zipOutputStream.setEncoding(ZIP_ENCODING);
byte[] content = getTailBytes(logFile);
ArchiveEntry archiveEntry = newTailArchive(logFile.getName(), content);
zipOutputStream.putArchiveEntry(archiveEntry);
zipOutputStream.write(content);
zipOutputStream.closeArchiveEntry();
zipOutputStream.close();
}
代码示例来源:origin: org.docx4j/docx4j
public void finishSave() throws Docx4JException {
try {
// Complete the ZIP file
// Don't forget to do this or everything will appear
// to work, but when you open the zip file you'll get an error
// "End-of-central-directory signature not found."
zos.close();
} catch (Exception e ) {
throw new Docx4JException("Failed to put binary part", e);
}
}
代码示例来源:origin: Alfresco/alfresco-repository
@Override
public void end()
{
try
{
zipStream.close();
}
catch (IOException error)
{
throw new ExporterException("Unexpected error closing zip stream!", error);
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-filter-stream-xar
@Override
public void close() throws IOException
{
// Add package.xml descriptor
try {
writePackage();
} catch (FilterException e) {
throw new IOException("Failed to write package", e);
}
// Close zip stream
this.zipStream.close();
}
}
代码示例来源:origin: org.openengsb.connector/org.openengsb.connector.git
@Override
public File export() {
try {
if (repository == null) {
initRepository();
}
LOGGER.debug("Exporting repository to archive");
File tmp = File.createTempFile("repository", ".zip");
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(tmp);
packRepository(localWorkspace, zos);
zos.close();
return tmp;
} catch (IOException e) {
throw new ScmException(e);
}
}
代码示例来源:origin: org.apache.wookie/wookie-parser
/**
* Packages the source file/folder up as a new Zip file
* @param source the source file or folder to be zipped
* @param target the zip file to create
* @throws IOException
*/
public static void repackZip(File source, File target) throws IOException{
ZipArchiveOutputStream out = new ZipArchiveOutputStream(target);
out.setEncoding("UTF-8");
for(File afile: source.listFiles()){
pack(afile,out, "");
}
out.flush();
out.close();
}
代码示例来源:origin: org.apache.slider/slider-core
public static void zipDir(String zipFile, String dir) throws IOException {
File dirObj = new File(dir);
ZipArchiveOutputStream out = new ZipArchiveOutputStream(new FileOutputStream(zipFile));
log.info("Creating : {}", zipFile);
try {
addDir(dirObj, out, "");
} finally {
out.close();
}
}
代码示例来源:origin: apache/incubator-slider
public static void zipDir(String zipFile, String dir) throws IOException {
File dirObj = new File(dir);
ZipArchiveOutputStream out = new ZipArchiveOutputStream(new FileOutputStream(zipFile));
log.info("Creating : {}", zipFile);
try {
addDir(dirObj, out, "");
} finally {
out.close();
}
}
我需要创建一个 zip 文件并受限于以下条件: 条目以 byte[](或 ByteArrayOutputStream)形式出现,而不是文件形式。 条目的文件名可以是非 ascii/UTF-8。 JDK
我正在使用 ZipArchiveOutputStream 将一些数据写入 zip 文件的条目。我需要写入 file1,创建另一个 file2 条目,向该条目添加一些数据,然后以某种方式再次写入我之前写
我正在使用 org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream 添加来自 Subversion 存储库的文件。只要我不在文
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.writeOut()方法的一些代码示例,展示了Zi
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.writeLocalFileHeader()方法的
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.handleSizesAndCrc()方法的一些代
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.checkIfNeedsZip64()方法的一些代
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.handleZip64Extra()方法的一些代码
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.getGeneralPurposeBits()方法
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.destroy()方法的一些代码示例,展示了Zip
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.hasZip64Extra()方法的一些代码示例,
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.getZip64Extra()方法的一些代码示例,
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.writeZip64CentralDirector
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.writeCentralDirectoryEnd(
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.usesDataDescriptor()方法的一些
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.setDefaults()方法的一些代码示例,展示
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.getEntryEncoding()方法的一些代码
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeEntry()方法的一些代码示例,展示了
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.validateSizeInformation()
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.rewriteSizesAndCrc()方法的一些
我是一名优秀的程序员,十分优秀!