Example usage for org.apache.commons.compress.archivers.tar TarArchiveEntry getGroupName

List of usage examples for org.apache.commons.compress.archivers.tar TarArchiveEntry getGroupName

Introduction

In this page you can find the example usage for org.apache.commons.compress.archivers.tar TarArchiveEntry getGroupName.

Prototype

public String getGroupName() 

Source Link

Document

Get this entry's group name.

Usage

From source file:org.vafer.jdeb.producers.DataProducerPathTemplate.java

public void produce(DataConsumer pReceiver) throws IOException {
    for (String literalPath : literalPaths) {
        TarArchiveEntry entry = new TarArchiveEntry(literalPath, true);
        entry.setUserId(0);/* w w w .j av  a2s . c o  m*/
        entry.setUserName("root");
        entry.setGroupId(0);
        entry.setGroupName("root");
        entry.setMode(TarArchiveEntry.DEFAULT_DIR_MODE);

        entry = map(entry);

        entry.setSize(0);

        pReceiver.onEachDir(entry.getName(), entry.getLinkName(), entry.getUserName(), entry.getUserId(),
                entry.getGroupName(), entry.getGroupId(), entry.getMode(), entry.getSize());
    }
}

From source file:org.vafer.jdeb.producers.Producers.java

/**
 * Forwards tar archive entry entry to a consumer.
 * @param consumer the consumer/* ww  w  . jav  a  2s.c om*/
 * @param entry the entry to pass
 * @throws IOException
 */
static void produceDirEntry(final DataConsumer consumer, final TarArchiveEntry entry) throws IOException {
    consumer.onEachDir(entry.getName(), entry.getLinkName(), entry.getUserName(), entry.getUserId(),
            entry.getGroupName(), entry.getGroupId(), entry.getMode(), entry.getSize());
}

From source file:org.vafer.jdeb.producers.Producers.java

/**
 * Feeds input stream to data consumer using metadata from tar entry.
 * @param consumer the consumer//from  ww  w  . j a  v a 2  s .c om
 * @param inputStream the stream to feed
 * @param entry the entry to use for metadata
 * @throws IOException on consume error
 */
static void produceInputStreamWithEntry(final DataConsumer consumer, final InputStream inputStream,
        final TarArchiveEntry entry) throws IOException {
    try {
        consumer.onEachFile(inputStream, entry.getName(), entry.getLinkName(), entry.getUserName(),
                entry.getUserId(), entry.getGroupName(), entry.getGroupId(), entry.getMode(), entry.getSize());
    } finally {
        IOUtils.closeQuietly(inputStream);
    }
}