com.sun.enterprise.admin.cli
Class ClassPathBuilder

java.lang.Object
  extended by com.sun.enterprise.admin.cli.ClassPathBuilder
All Implemented Interfaces:
java.lang.Iterable<java.io.File>

public class ClassPathBuilder
extends java.lang.Object
implements java.lang.Iterable<java.io.File>

Builds up a classpath.

Author:
Kohsuke Kawaguchi

Field Summary
private  java.util.List<java.io.File> elements
           
 
Constructor Summary
ClassPathBuilder()
           
 
Method Summary
 ClassPathBuilder add(java.io.File f)
          Adds a single jar file or a class file directory.
 ClassPathBuilder add(java.io.File f, java.lang.String... pathFragments)
          Allows one to write add(f,"lib","a.jar") instead of add(new File(new File(f,"lib"),"a.jar")
 ClassPathBuilder addAll(java.io.File... files)
           
 ClassPathBuilder addAll(java.io.File dir, java.io.FileFilter filter)
          Adds all the files in the given directory that match the given filter.
 java.util.Iterator<java.io.File> iterator()
           
 java.lang.String toString()
          Formats the path in a single-argument format suitable after the "-cp" JVM option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elements

private final java.util.List<java.io.File> elements
Constructor Detail

ClassPathBuilder

public ClassPathBuilder()
Method Detail

iterator

public java.util.Iterator<java.io.File> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.io.File>

add

public ClassPathBuilder add(java.io.File f)
Adds a single jar file or a class file directory.


add

public ClassPathBuilder add(java.io.File f,
                            java.lang.String... pathFragments)
Allows one to write add(f,"lib","a.jar") instead of add(new File(new File(f,"lib"),"a.jar")


addAll

public ClassPathBuilder addAll(java.io.File dir,
                               java.io.FileFilter filter)
Adds all the files in the given directory that match the given filter.


addAll

public ClassPathBuilder addAll(java.io.File... files)

toString

public java.lang.String toString()
Formats the path in a single-argument format suitable after the "-cp" JVM option.

Overrides:
toString in class java.lang.Object


Copyright © 2012 GlassFish Community. All Rights Reserved.