org.apache.commons.compress.utils.CharsetNames Java Examples

The following examples show how to use org.apache.commons.compress.utils.CharsetNames. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PayloadRecorder.java    From packagedrone with Eclipse Public License 1.0 5 votes vote down vote up
public PayloadRecorder ( final boolean autoFinish, final PayloadCoding payloadCoding, final String payloadFlags, final DigestAlgorithm fileDigestAlgorithm ) throws IOException
{
    this.autoFinish = autoFinish;

    this.fileDigestAlgorithm = fileDigestAlgorithm;

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

    try
    {
        this.fileStream = new BufferedOutputStream ( Files.newOutputStream ( this.tempFile, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING ) );

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

        this.payloadCoding = payloadCoding;

        this.payloadFlags = Optional.ofNullable ( payloadFlags );

        final OutputStream payloadStream = this.payloadCoding.createProvider ().createOutputStream ( this.payloadCounter, this.payloadFlags );

        this.archiveCounter = new CountingOutputStream ( payloadStream );

        // setup archive stream

        this.archiveStream = new CpioArchiveOutputStream ( this.archiveCounter, CpioConstants.FORMAT_NEW, 4, CharsetNames.UTF_8 );
    }
    catch ( final IOException e )
    {
        Files.deleteIfExists ( this.tempFile );
        throw e;
    }
}
 
Example #2
Source File: Cpio.java    From gradle-plugins with MIT License 4 votes vote down vote up
public Cpio() {
    getArchiveExtension().convention("cpio");
    format.convention(CpioConstants.FORMAT_NEW);
    blockSize.convention(CpioConstants.BLOCK_SIZE);
    encoding.convention(CharsetNames.US_ASCII);
}
 
Example #3
Source File: Cpio.java    From gradle-plugins with MIT License 4 votes vote down vote up
public Cpio() {
    getArchiveExtension().convention("cpio");
    format.convention(CpioConstants.FORMAT_NEW);
    blockSize.convention(CpioConstants.BLOCK_SIZE);
    encoding.convention(CharsetNames.US_ASCII);
}