FileDocCategorySizeDatePackage
StaticWeaveJAROutputHandler.javaAPI DocGlassfish v2 API4012Tue May 22 16:54:44 BST 2007oracle.toplink.essentials.internal.weaving

StaticWeaveJAROutputHandler

public class StaticWeaveJAROutputHandler extends AbstractStaticWeaveOutputHandler
The class provides a set of methods to pack passing in entries into the sepcified archive file. the class JAR output.

Fields Summary
Constructors Summary
public StaticWeaveJAROutputHandler(JarOutputStream outputStreamHolder)
Construct an instance of StaticWeaveJAROutputHandler

param
outputStreamHolder

        super.outputStreamHolder=outputStreamHolder;
    
Methods Summary
public voidaddDirEntry(java.lang.String dirPath)
Add directory entry into outputstream.

param
dirPath
throws
IOException

        try{
            JarEntry newEntry = new JarEntry(dirPath);
            newEntry.setSize(0);
            addEntry(newEntry, null);
        }catch(ZipException e){
            //ignore duplicate directory entry exceptions.
        }
    
public voidaddEntry(java.util.jar.JarEntry targetEntry, byte[] entryBytes)
Write entry bytes into target, this method is usually called if class has been tranformed

param
targetEntry
param
entryBytes
throws
IOException

        outputStreamHolder.putNextEntry(targetEntry);
        if(entryBytes!=null){
            outputStreamHolder.write(entryBytes);
        }
        outputStreamHolder.closeEntry();
    
public voidaddEntry(java.io.InputStream jis, java.util.jar.JarEntry entry)
Write entry into target, this method usually copy original class into target.

param
jis
param
entry
throws
IOException

    
        outputStreamHolder.putNextEntry(entry);
        if(!entry.isDirectory()){
           readwriteStreams(jis,outputStreamHolder);
        }
        outputStreamHolder.closeEntry();