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

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

Introduction

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

Prototype

int C_ISREG

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

Click Source Link

Document

Defines a regular file

Usage

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

private <T> void addFile(final String targetName, final T sourcePath, final Consumer<FileEntry> customizer,
        final int mode, final Instant fileModificationInstant, final RecorderFunction<T> func)
        throws IOException {
    final PathName pathName = PathName.parse(targetName);

    final long mtime = fileModificationInstant.getEpochSecond();
    final int inode = this.currentInode++;

    final short smode = (short) (mode | CpioConstants.C_ISREG);

    final Result result = func.record(this.recorder, "./" + pathName.toString(), sourcePath,
            cpioCustomizer(mtime, inode, smode));

    Consumer<FileEntry> c = this::initEntry;
    c = c.andThen(entry -> {//from   www  . j av  a2  s  .  com
        entry.setModificationTime((int) mtime);
        entry.setInode(inode);
        entry.setMode(smode);
    });

    if (customizer != null) {
        c = c.andThen(customizer);
    }

    addResult(pathName, result, c);
}