Example usage for java.util.jar JarEntry JarEntry

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

Introduction

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

Prototype

public JarEntry(JarEntry je) 

Source Link

Document

Creates a new JarEntry with fields taken from the specified JarEntry object.

Usage

From source file:rubah.tools.ConversionClassGenerator.java

public void addConversionClassesToJar(JarOutputStream jos, Clazz cl) throws IOException {
    jos.putNextEntry(new JarEntry(this.getType(cl).getInternalName() + ".class"));
    IOUtils.write(this.getClassBytes(cl), jos);
}

From source file:rubah.tools.ReadWriteTool.java

protected void addFileToOutJar(String name, byte[] bytes) {
    JarEntry entry = new JarEntry(name);
    try {//from  w w  w.j ava2  s .  c  om
        this.outJarStream.putNextEntry(entry);
        if (bytes != null) {
            this.outJarStream.write(bytes, 0, bytes.length);
        }
        this.outJarStream.closeEntry();
    } catch (IOException e) {
        throw new Error(e);
    }
}