|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.tools.LoaderConfiguration
public class LoaderConfiguration
Class used to configure a RootLoader from a stream or by using it's methods.
The stream can be for example a FileInputStream from a file with the following format:# comment main is classname load path load file load pathWith${property} load pathWith!{required.property} load path/*.jar load path/**/*.jar
RootLoader
Field Summary | |
---|---|
private static java.lang.String |
ALL_WILDCARD
|
private java.util.List |
classPath
|
private static java.lang.String |
LOAD_PREFIX
|
private java.lang.String |
main
|
private static java.lang.String |
MAIN_PREFIX
|
private static java.lang.String |
MATCH_ALL
|
private static java.lang.String |
MATCH_FILE_NAME
|
private boolean |
requireMain
|
private static char |
WILDCARD
|
Constructor Summary | |
---|---|
LoaderConfiguration()
creates a new loader configuration |
Method Summary | |
---|---|
void |
addClassPath(java.lang.String path)
Adds a classpath to this configuration. |
void |
addFile(java.io.File file)
Adds a file to the classpath if it exists. |
void |
addFile(java.lang.String filename)
Adds a file to the classpath if it exists. |
private java.lang.String |
assignProperties(java.lang.String str)
|
void |
configure(java.io.InputStream is)
configures this loader with a stream |
private void |
findMatchingFiles(java.io.File[] files,
java.util.regex.Pattern pattern,
boolean recursive)
|
java.net.URL[] |
getClassPathUrls()
The classpath as URL[] from this configuration. |
java.lang.String |
getMainClass()
Returns the name of the main class for this configuration. |
private java.lang.String |
getParentPath(java.lang.String filter)
|
private java.lang.String |
getSlashyPath(java.lang.String path)
|
private void |
loadFilteredPath(java.lang.String filter)
|
private boolean |
parentPathDoesExist(java.lang.String path)
|
void |
setMainClass(java.lang.String classname)
Sets the main class. |
void |
setRequireMain(boolean requireMain)
Determines if a main class is required when calling. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String MAIN_PREFIX
private static final java.lang.String LOAD_PREFIX
private java.util.List classPath
private java.lang.String main
private boolean requireMain
private static final char WILDCARD
private static final java.lang.String ALL_WILDCARD
private static final java.lang.String MATCH_FILE_NAME
private static final java.lang.String MATCH_ALL
Constructor Detail |
---|
public LoaderConfiguration()
Method Detail |
---|
public void configure(java.io.InputStream is) throws java.io.IOException
is
- stream used to read the configuration
java.io.IOException
- if reading or parsing the contents of the stream failsprivate java.lang.String assignProperties(java.lang.String str)
private void loadFilteredPath(java.lang.String filter)
private void findMatchingFiles(java.io.File[] files, java.util.regex.Pattern pattern, boolean recursive)
private java.lang.String getSlashyPath(java.lang.String path)
private boolean parentPathDoesExist(java.lang.String path)
private java.lang.String getParentPath(java.lang.String filter)
public void addFile(java.io.File file)
file
- the file to addpublic void addFile(java.lang.String filename)
filename
- the name of the file to addpublic void addClassPath(java.lang.String path)
path
- the path as a path separator delimited stringFile.pathSeparator
public java.net.URL[] getClassPathUrls()
URLClassLoader
public java.lang.String getMainClass()
public void setMainClass(java.lang.String classname)
classname
- the name to become the main classpublic void setRequireMain(boolean requireMain)
requireMain
- set to false if no main class is requiredconfigure(InputStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |