jxUtil 0.6

org.sourceforge.jxutil.app
Class OneJAR

java.lang.Object
  |
  +--org.sourceforge.jxutil.app.OneJAR

public class OneJAR
extends Object

A dependency aware JAR packager. Usage:
java -cp classPath org.sourceforge.jxutil.app.OneJAR jarFile [classes...] [-m manifest-file] When used without classes the jarFile is modified to contain a closure of dependencies that can be resolved to classes in the classPath. With classes, the jarFile is created to additionally contain the classes with the dependencies resolved.

Author:
Keve Müller

Nested Class Summary
static class OneJAR.ClassDataSource
          The abstract source for class definition.
static class OneJAR.FileClassDataSource
          Classes in the filesystem.
static class OneJAR.JarClassDataSource
          Classes as part of a JAR file.
 
Field Summary
private static int verbosity
           
 
Constructor Summary
OneJAR()
           
 
Method Summary
private static void loadDir(File dir, String prefix, Map map)
          Load a directory including all subdirectories and build String classname to ClassDataSource mappings.
private static void loadProvides(String jarFile, Set providedSet)
           
private static void loadReferences(String jd, Map map)
          Load the classes defined at a given location (directory or JAR).
static void main(String[] argv)
           
private static void oneJar(String[] providedGlobalA, String[] referencesA, String[] sourcesA, String manifestFile)
           
private static void resolve(String jarSource, Map resolution, String manifestFile)
           
private static void usage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbosity

private static int verbosity
Constructor Detail

OneJAR

public OneJAR()
Method Detail

loadDir

private static void loadDir(File dir,
                            String prefix,
                            Map map)
                     throws IOException
Load a directory including all subdirectories and build String classname to ClassDataSource mappings.

Parameters:
dir - The directory to scan.
prefix - The package prefix.
map - The map to store the results in.
Throws:
IOException - If a file system access error occurs.

loadProvides

private static void loadProvides(String jarFile,
                                 Set providedSet)
                          throws IOException
IOException

loadReferences

private static void loadReferences(String jd,
                                   Map map)
                            throws IOException
Load the classes defined at a given location (directory or JAR). The passed map is populated with the ClassDataSource elements that are found under the given location. They are keyed by the class name.

Parameters:
jd - The String representation of a file system directory or a JAR file.
map - The map to populate.
IOException

main

public static void main(String[] argv)

oneJar

private static void oneJar(String[] providedGlobalA,
                           String[] referencesA,
                           String[] sourcesA,
                           String manifestFile)
                    throws IOException
IOException

resolve

private static void resolve(String jarSource,
                            Map resolution,
                            String manifestFile)
                     throws IOException
IOException

usage

private static void usage()

jxUtil 0.6

Copyright © 2001,2002 Keve Müller, et al.; see LICENSE file for details.