Example usage for org.apache.commons.compress.archivers.cpio CpioConstants FORMAT_NEW

List of usage examples for org.apache.commons.compress.archivers.cpio CpioConstants FORMAT_NEW

Introduction

In this page you can find the example usage for org.apache.commons.compress.archivers.cpio CpioConstants FORMAT_NEW.

Prototype

short FORMAT_NEW

To view the source code for org.apache.commons.compress.archivers.cpio CpioConstants FORMAT_NEW.

Click Source Link

Document

write/read a CPIOArchiveEntry in the new format

Usage

From source file:org.eclipse.packagedrone.utils.rpm.build.PayloadRecorder.java

public PayloadRecorder(final boolean autoFinish) throws IOException {
    this.autoFinish = autoFinish;

    this.tempFile = Files.createTempFile("rpm-", null);

    try {//from  w  w  w.  j  av  a2s.co  m
        this.fileStream = new BufferedOutputStream(Files.newOutputStream(this.tempFile,
                StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING));

        this.payloadCounter = new CountingOutputStream(this.fileStream);

        final GZIPOutputStream payloadStream = new GZIPOutputStream(this.payloadCounter);
        this.archiveCounter = new CountingOutputStream(payloadStream);

        // setup archive stream

        this.archiveStream = new CpioArchiveOutputStream(this.archiveCounter, CpioConstants.FORMAT_NEW, 4,
                "UTF-8");
    } catch (final IOException e) {
        Files.deleteIfExists(this.tempFile);
        throw e;
    }
}