|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jdo.impl.enhancer.ClassFileEnhancerHelper
This is a helper-class to perform some useful operations outside a byte code enhancer and delegate the real work to the enhancer.
| Constructor Summary | |
ClassFileEnhancerHelper()
|
|
| Method Summary | |
private static void |
copyZipEntry(java.io.InputStream in,
java.io.OutputStream out)
Copies a zip entry from one stream to another. |
static boolean |
enhanceClassFile(ClassFileEnhancer enhancer,
java.io.InputStream in,
java.io.OutputStream out)
Enhances a classfile. |
static boolean |
enhanceZipFile(ClassFileEnhancer enhancer,
java.util.zip.ZipInputStream zip_in,
java.util.zip.ZipOutputStream zip_out)
Enhances a zip file. |
private static boolean |
isClassFileEntry(java.util.zip.ZipEntry entry)
Determines if a given entry represents a classfile. |
private static void |
modifyZipEntry(java.util.zip.ZipEntry entry,
byte[] bytes,
java.util.zip.CRC32 crc32)
Modifies the given zip entry so that it can be added to zip file. |
private static java.io.InputStream |
openZipEntry(java.util.zip.ZipInputStream in)
Opens the next zip entry of a zip input stream and copies it to a java.io.ByteArrayOutputStream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ClassFileEnhancerHelper()
| Method Detail |
public static boolean enhanceClassFile(ClassFileEnhancer enhancer,
java.io.InputStream in,
java.io.OutputStream out)
throws EnhancerUserException,
EnhancerFatalError
enhancer - The enhancer to delegate the work to.in - The input stream with the Java class.out - The output stream to write the enhanced class to.
EnhancerUserException - If something went wrong.
EnhancerFatalError - If something went wrong.ClassFileEnhancer.enhanceClassFile(java.io.InputStream, java.io.OutputStream)
public static boolean enhanceZipFile(ClassFileEnhancer enhancer,
java.util.zip.ZipInputStream zip_in,
java.util.zip.ZipOutputStream zip_out)
throws EnhancerUserException,
EnhancerFatalError
enhancer - The enhancer.zip_in - The zip input stream.zip_out - The zip output stream.
true if at least one entry of the zip file has
been enhanced, false otherwise.
EnhancerUserException - If something went wrong.
EnhancerFatalError - If something went wrong.ClassFileEnhancer.enhanceClassFile(java.io.InputStream, java.io.OutputStream)
private static void copyZipEntry(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - The inout stream.out - The output stream.
java.io.IOException - If the stream access failed.
private static java.io.InputStream openZipEntry(java.util.zip.ZipInputStream in)
throws java.io.IOException
java.io.ByteArrayOutputStream. It's byte array is made
available via an java.io.ByteArrayInputStream which is
returned.
in - The zip input stream.
java.io.IOException - If an I/O operation failed.
private static void modifyZipEntry(java.util.zip.ZipEntry entry,
byte[] bytes,
java.util.zip.CRC32 crc32)
entry - The zip entry to modify.bytes - The uncompressed byte representation of the classfile.crc32 - The checksum evaluator.private static boolean isClassFileEntry(java.util.zip.ZipEntry entry)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||