Example usage for java.util.jar JarEntry getExtra

List of usage examples for java.util.jar JarEntry getExtra

Introduction

In this page you can find the example usage for java.util.jar JarEntry getExtra.

Prototype

public byte[] getExtra() 

Source Link

Document

Returns the extra field data for the entry.

Usage

From source file:org.apache.pluto.util.assemble.io.JarStreamingAssembly.java

private static JarEntry smartClone(JarEntry originalJarEntry) {
    final JarEntry newJarEntry = new JarEntry(originalJarEntry.getName());
    newJarEntry.setComment(originalJarEntry.getComment());
    newJarEntry.setExtra(originalJarEntry.getExtra());
    newJarEntry.setMethod(originalJarEntry.getMethod());
    newJarEntry.setTime(originalJarEntry.getTime());

    //Must set size and CRC for STORED entries
    if (newJarEntry.getMethod() == ZipEntry.STORED) {
        newJarEntry.setSize(originalJarEntry.getSize());
        newJarEntry.setCrc(originalJarEntry.getCrc());
    }/*ww  w.ja va  2s  . c o m*/

    return newJarEntry;
}

From source file:org.jahia.modules.serversettings.portlets.BasePortletHelper.java

static JarEntry cloneEntry(JarEntry originalJarEntry) {
    final JarEntry newJarEntry = new JarEntry(originalJarEntry.getName());
    newJarEntry.setComment(originalJarEntry.getComment());
    newJarEntry.setExtra(originalJarEntry.getExtra());
    newJarEntry.setMethod(originalJarEntry.getMethod());
    newJarEntry.setTime(originalJarEntry.getTime());

    // Must set size and CRC for STORED entries
    if (newJarEntry.getMethod() == ZipEntry.STORED) {
        newJarEntry.setSize(originalJarEntry.getSize());
        newJarEntry.setCrc(originalJarEntry.getCrc());
    }/* w  w  w  . j a v a 2s. c o  m*/

    return newJarEntry;
}