public class JarFileCreator extends Object
This class is thread-safe.
| Constructor and Description |
|---|
JarFileCreator(File outputFile)
Constructs a new jar file creator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClass(Class<?> clazz)
Adds a
Class object to the set of classes which shall eventually be included in the jar file. |
void |
createJarFile()
Creates a jar file which contains the previously added class.
|
public JarFileCreator(File outputFile)
outputFile - the file which shall contain the output data, i.e. the final jar filepublic void addClass(Class<?> clazz)
Class object to the set of classes which shall eventually be included in the jar file.clazz - the class to be added to the jar file.public void createJarFile()
throws IOException
outputFile which has been provided to the constructor. If outputFile already exists, it
is overwritten by this operation.IOException - thrown if an error occurs while writing to the output fileCopyright © 2014 The Apache Software Foundation. All rights reserved.