|
SandMark version 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sandmark.util.ClassFileCollection
The sandmark.util.ClassFileCollection class provides methods for accessing a collection of files including Java bytecode files. Conceptually, the collection is like an editable jar file. Actually, it is a hidden directory of files. When no longer needed, a collection should be explicitly closed to avoid leaving debris in /tmp.
Constructor Summary | |
ClassFileCollection()
Constructs a new, empty collection. |
|
ClassFileCollection(java.lang.String filename)
Constructs a collection and initializes it with the contents of a Jar file. |
Method Summary | |
void |
add(java.lang.String filename,
byte[] data)
Adds or replaces a file in this collection. |
void |
add(java.lang.String filename,
java.io.File source)
Adds or replaces a file in this collection. |
void |
addClass(EDU.purdue.cs.bloat.reflect.ClassInfo c)
Adds or replaces a class in this collection, given a BLOAT ClassInfo. |
void |
addClass(de.fub.bytecode.classfile.JavaClass c)
Adds or replaces a class in this collection, given a JavaClass. |
java.util.Iterator |
classes()
Returns an iterator that produces the names of the classes contained in this collection. |
void |
close()
Closes this collection, rendering it invalid. |
void |
delete(java.lang.String filename)
Deletes a file from this collection. |
void |
deleteClass(java.lang.String classname)
Deletes a class from the collection. |
java.util.Iterator |
files()
Returns an iterator that produces the names of the files contained in this collection. |
protected void |
finalize()
Finalizes this collection by closing it. |
byte[] |
get(java.lang.String filename)
Extracts a member of this collection. |
void |
get(java.lang.String filename,
java.io.File dest)
Extracts a member of this collection and saves it in a file. |
de.fub.bytecode.classfile.JavaClass |
getClass(java.lang.String classname)
Extracts a class as a JavaClass. |
EDU.purdue.cs.bloat.file.ClassFile |
getClassFile(java.lang.String classname)
Extracts a class as a BLOAT ClassFile. |
java.lang.String |
getClassPath()
Returns the classpath associated with the BLOAT ClassFileLoader. |
EDU.purdue.cs.bloat.file.ClassFileLoader |
getLoader()
Returns the BLOAT ClassFileLoader associated with this ClassFileCollection. |
java.lang.String |
getMain()
Returns the main-class attribute of the collection, or null if no main class has been set. |
java.util.jar.Manifest |
getManifest()
Returns the attribute manifest associated with this collection. |
void |
optimise_saveJar(java.lang.String filename)
Optimises and Saves this collection in a new Jar file. |
void |
saveJar(java.util.jar.JarOutputStream js)
|
void |
saveJar(java.lang.String filename)
Saves this collection in a new Jar file. |
void |
setMain(java.lang.String classname)
Sets the main-class attribute of this collection, or clears it if the argument is null. |
java.lang.String |
toString()
Returns a String representation of this ClassFileCollection. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClassFileCollection() throws java.io.IOException
public ClassFileCollection(java.lang.String filename) throws java.io.IOException
Method Detail |
public final void saveJar(java.util.jar.JarOutputStream js) throws java.io.IOException
java.io.IOException
public final void saveJar(java.lang.String filename) throws java.io.IOException
java.io.IOException
public void optimise_saveJar(java.lang.String filename) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.util.jar.Manifest getManifest()
public byte[] get(java.lang.String filename) throws java.io.IOException
java.io.IOException
public void get(java.lang.String filename, java.io.File dest) throws java.io.IOException
java.io.IOException
public void add(java.lang.String filename, java.io.File source) throws java.io.IOException
java.io.IOException
public void add(java.lang.String filename, byte[] data) throws java.io.IOException
java.io.IOException
public void delete(java.lang.String filename) throws java.io.IOException
java.io.IOException
public java.util.Iterator files() throws java.io.IOException
java.io.IOException
public java.lang.String getMain()
public void setMain(java.lang.String classname)
public de.fub.bytecode.classfile.JavaClass getClass(java.lang.String classname) throws java.io.IOException
java.io.IOException
public void addClass(de.fub.bytecode.classfile.JavaClass c) throws java.io.IOException
java.io.IOException
public EDU.purdue.cs.bloat.file.ClassFile getClassFile(java.lang.String classname) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void addClass(EDU.purdue.cs.bloat.reflect.ClassInfo c) throws java.io.IOException
java.io.IOException
public EDU.purdue.cs.bloat.file.ClassFileLoader getLoader()
public java.lang.String getClassPath()
public void deleteClass(java.lang.String classname) throws java.io.IOException
java.io.IOException
public java.util.Iterator classes() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
SandMark version 2.0 Mon Jun 17 12:30:47 MST 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |