public class JarUtil
extends java.lang.Object
Constructor and Description |
---|
JarUtil() |
Modifier and Type | Method and Description |
---|---|
static ClassPool |
readJar(java.lang.String jarFileName,
boolean isLibrary)
Reads the classes from the specified jar file and returns them as a class pool.
|
static ClassPool |
readJar(java.lang.String jarFileName,
java.lang.String classNameFilter,
boolean isLibrary)
Reads the classes from the specified jar file and returns them as a class pool.
|
static void |
writeJar(ClassPool programClassPool,
java.lang.String outputJarFileName)
Writes the classes from the given class pool to a specified jar.
|
public static ClassPool readJar(java.lang.String jarFileName, boolean isLibrary) throws java.io.IOException
jarFileName
- the name of the jar file or jmod file.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).java.io.IOException
public static ClassPool readJar(java.lang.String jarFileName, java.lang.String classNameFilter, boolean isLibrary) throws java.io.IOException
jarFileName
- the name of the jar file or jmod file.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).java.io.IOException
public static void writeJar(ClassPool programClassPool, java.lang.String outputJarFileName) throws java.io.IOException
programClassPool
- the classes to write.outputJarFileName
- the name of the output jar file.java.io.IOException