Example usage for org.apache.commons.compress.archivers.jar JarArchiveEntry setComment

List of usage examples for org.apache.commons.compress.archivers.jar JarArchiveEntry setComment

Introduction

In this page you can find the example usage for org.apache.commons.compress.archivers.jar JarArchiveEntry setComment.

Prototype

public void setComment(String comment) 

Source Link

Document

Sets the optional comment string for the entry.

Usage

From source file:org.springframework.boot.loader.tools.JarWriter.java

private EntryWriter addUnpackCommentIfNecessary(JarArchiveEntry entry, EntryWriter entryWriter,
        UnpackHandler unpackHandler) throws IOException {
    if (entryWriter == null || !unpackHandler.requiresUnpack(entry.getName())) {
        return entryWriter;
    }/*from w w w.  j a  v a2s .c o m*/
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    entryWriter.write(output);
    entry.setComment("UNPACK:" + unpackHandler.sha1Hash(entry.getName()));
    return new InputStreamEntryWriter(new ByteArrayInputStream(output.toByteArray()), true);
}