com.jaxfront.core.util.io.classloader
Class DumpClassVersions
java.lang.Object
com.jaxfront.core.util.io.classloader.DumpClassVersions
- All Implemented Interfaces:
- IJREVersion
public class DumpClassVersions
- extends java.lang.Object
- implements IJREVersion
A simple tool to dump class version stamps from a given set of classes. The input classes could be enumerated as standalone .class files or as
contained in class libraries. This class recurses into all directories it encounters.
Usage: DumpClassVersions <file|dir|archive> <file|dir|archive> ...
This class is Java 1.1-compatible. It also serves as another demo of how to use IJREVersion.
|
Field Summary |
static java.lang.String |
USAGE
|
|
Method Summary |
static java.lang.String |
dump(java.lang.String className,
byte[] classBytes)
|
static void |
dumpClassFile(java.io.File file,
java.io.PrintWriter out)
|
static void |
dumpClassFile(java.lang.String className,
java.lang.String location,
byte[] in,
java.io.PrintWriter out)
|
static void |
dumpClassFile(java.lang.String className,
java.lang.String location,
java.io.InputStream in,
java.io.PrintWriter out)
|
static void |
dumpClassVersion(java.io.File file,
java.io.PrintWriter out)
Examines all class definitions that could be found in 'file' [which could be a directory or zip/jar archive] and dumps their version stamps to
'out'. |
static void |
dumpDirectory(java.io.File dir,
java.io.PrintWriter out)
|
static java.lang.String |
findManifestInfoInJAR(java.lang.Class<?> c,
java.lang.String jarName,
java.lang.String name)
|
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USAGE
public static final java.lang.String USAGE
- See Also:
- Constant Field Values
DumpClassVersions
public DumpClassVersions()
dump
public static java.lang.String dump(java.lang.String className,
byte[] classBytes)
dumpClassFile
public static void dumpClassFile(java.io.File file,
java.io.PrintWriter out)
throws java.io.IOException
- Throws:
java.io.IOException
dumpClassFile
public static void dumpClassFile(java.lang.String className,
java.lang.String location,
byte[] in,
java.io.PrintWriter out)
throws java.io.IOException
- Throws:
java.io.IOException
dumpClassFile
public static void dumpClassFile(java.lang.String className,
java.lang.String location,
java.io.InputStream in,
java.io.PrintWriter out)
throws java.io.IOException
- Throws:
java.io.IOException
dumpClassVersion
public static void dumpClassVersion(java.io.File file,
java.io.PrintWriter out)
throws java.io.IOException
- Examines all class definitions that could be found in 'file' [which could be a directory or zip/jar archive] and dumps their version stamps to
'out'.
- Throws:
java.io.IOException - on any I/O error
dumpDirectory
public static void dumpDirectory(java.io.File dir,
java.io.PrintWriter out)
throws java.io.IOException
- Throws:
java.io.IOException
findManifestInfoInJAR
public static java.lang.String findManifestInfoInJAR(java.lang.Class<?> c,
java.lang.String jarName,
java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException