Example usage for org.apache.commons.compress.archivers.zip ZipArchiveOutputStream setMethod

List of usage examples for org.apache.commons.compress.archivers.zip ZipArchiveOutputStream setMethod

Introduction

In this page you can find the example usage for org.apache.commons.compress.archivers.zip ZipArchiveOutputStream setMethod.

Prototype

public void setMethod(int method) 

Source Link

Document

Sets the default compression method for subsequent entries.

Usage

From source file:org.jboss.tools.windup.ui.internal.archiver.ZipFileExporter.java

/**
 * @see org.jboss.tools.windup.ui.internal.archiver.AbstractArchiveFileExporter#createOutputStream(java.lang.String, boolean)
 *//*from   w  w w  .j a v a  2 s .co  m*/
@Override
protected ArchiveOutputStream createOutputStream(String archiveName, boolean compress) throws IOException {

    ZipArchiveOutputStream zipOut = new ZipArchiveOutputStream(new FileOutputStream(archiveName));
    zipOut.setMethod(compress ? ZipEntry.DEFLATED : ZipEntry.STORED);
    return zipOut;
}