public class Jar extends Object
JarFiles enabling quick access to the
jar's main class, as well as the ability to get the InputStream of a
class file, and speedy lookups to see if the jar contains the specified
class.| Constructor and Description |
|---|
Jar() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsClass(String clazz)
Check if this jar contains the given class.
|
InputStream |
getClass(String clazz)
Takes the internal name of a class (/).
|
Set<String> |
getEntryNames()
Get all file names in the jar, (archive order is preserved).
|
org.objectweb.asm.tree.ClassNode |
getNode(String clazz)
Get the
ClassNode object corresponding to this class. |
InputStream |
getResource(String name)
Get the stream for a file in this jar.
|
static Jar |
init(File file)
Read a new jar instance from the given file.
|
static Jar |
init(List<File> files)
Read a new jar instance from the given list of files.
|
public boolean containsClass(String clazz)
clazz - public InputStream getResource(String name) throws IOException
name - IOExceptionpublic InputStream getClass(String clazz) throws IOException
clazz - IOExceptionpublic org.objectweb.asm.tree.ClassNode getNode(String clazz)
ClassNode object corresponding to this class. Takes the
internal name of a class (/)clazz - public Set<String> getEntryNames()
public static Jar init(File file) throws IOException
file - IOExceptionpublic static Jar init(List<File> files) throws IOException
files - IOExceptionCopyright © 2012-2015. All Rights Reserved.