com.sun.enterprise.admin.cli
Class ClassPathBuilder

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

public class ClassPathBuilder
extends Object
implements Iterable<File>

Builds up a classpath.

Author:
Kohsuke Kawaguchi

Constructor Summary
ClassPathBuilder()
           
 
Method Summary
 ClassPathBuilder add(File f)
          Adds a single jar file or a class file directory.
 ClassPathBuilder add(File f, String... pathFragments)
          Allows one to write add(f,"lib","a.jar") instead of add(new File(new File(f,"lib"),"a.jar")
 ClassPathBuilder addAll(File... files)
           
 ClassPathBuilder addAll(File dir, FileFilter filter)
          Adds all the files in the given directory that match the given filter.
 Iterator<File> iterator()
           
 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
 

Constructor Detail

ClassPathBuilder

public ClassPathBuilder()
Method Detail

iterator

public Iterator<File> iterator()
Specified by:
iterator in interface Iterable<File>

add

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


add

public ClassPathBuilder add(File f,
                            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(File dir,
                               FileFilter filter)
Adds all the files in the given directory that match the given filter.


addAll

public ClassPathBuilder addAll(File... files)

toString

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

Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.