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
load ./*.jar or load *.jar are not supported.Defining the main class is required unless setRequireMain(boolean) is called with false, before reading the configuration. You can use the wildcard "*" to filter the path, but only for files, not directories. To match directories use "**". The ${propertyname} is replaced by the value of the system's property name. You can use user.home here for example. If the property does not exist, an empty string will be used. If the path or file after the load command does not exist, the path will be ignored.
RootLoader
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private final List | |
| private static final String | |
| private final List | |
| private static final String | |
| private final List | |
| private static final String | |
| private String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private boolean | |
| private static final char |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addClassPath(String
the path as a path separator delimited string path)Adds a classpath to this configuration. |
| public void | |
| public void | |
| private static String | |
| public void | |
| private static String | |
| private void | |
| public URL[] | |
| public List | |
| public String | Returns: the name of the main class or null if not definedReturns the name of the main class for this configuration. |
| private static String | |
| private void | |
| public void | |
| public void | setRequireMain(boolean
set to false if no main class is required requireMain)Determines if a main class is required when calling. |
| ALL_WILDCARD | back to summary |
|---|---|
| private static final String ALL_WILDCARD | |
| classPath | back to summary |
|---|---|
| private final List<URL> classPath | |
| CONFIGSCRIPT_PREFIX | back to summary |
|---|---|
| private static final String CONFIGSCRIPT_PREFIX | |
| configScripts | back to summary |
|---|---|
| private final List<String> configScripts | |
| GRAB_PREFIX | back to summary |
|---|---|
| private static final String GRAB_PREFIX | |
| grabList | back to summary |
|---|---|
| private final List<String> grabList | |
| LOAD_PREFIX | back to summary |
|---|---|
| private static final String LOAD_PREFIX | |
| main | back to summary |
|---|---|
| private String main | |
| MAIN_PREFIX | back to summary |
|---|---|
| private static final String MAIN_PREFIX | |
| MATCH_ALL | back to summary |
|---|---|
| private static final String MATCH_ALL | |
| MATCH_FILE_NAME | back to summary |
|---|---|
| private static final String MATCH_FILE_NAME | |
| PROP_PREFIX | back to summary |
|---|---|
| private static final String PROP_PREFIX | |
| requireMain | back to summary |
|---|---|
| private boolean requireMain | |
| WILDCARD | back to summary |
|---|---|
| private static final char WILDCARD | |
| LoaderConfiguration | back to summary |
|---|---|
| public LoaderConfiguration() creates a new loader configuration | |
| addClassPath | back to summary |
|---|---|
| public void addClassPath(String path) Adds a classpath to this configuration. It expects a string with multiple paths, separated by the system dependent path separator. Expands wildcards, e.g. dir/* into all the jars in dir.
| |
| addFile | back to summary |
|---|---|
| public void addFile(File file) Adds a file to the classpath if it exists.
| |
| addFile | back to summary |
|---|---|
| public void addFile(String filename) Adds a file to the classpath if it exists.
| |
| assignProperties | back to summary |
|---|---|
| private static String assignProperties(String str) | |
| configure | back to summary |
|---|---|
| public void configure(InputStream is) throws IOException configures this loader with a stream
| |
| correctDoubleSlash | back to summary |
|---|---|
| private static String correctDoubleSlash(String propertyValue, int propertyIndexEnd, String str) | |
| findMatchingFiles | back to summary |
|---|---|
| private void findMatchingFiles(File[] files, Pattern pattern, boolean recursive) | |
| getClassPathUrls | back to summary |
|---|---|
| public URL[] getClassPathUrls() The classpath as URL[] from this configuration. This can be used to construct a class loader.
| |
| getGrabUrls | back to summary |
|---|---|
| public List The extra grab configuration. | |
| getMainClass | back to summary |
|---|---|
| public String getMainClass() Returns the name of the main class for this configuration.
| |
| getSlashyPath | back to summary |
|---|---|
| private static String getSlashyPath(final String path) | |
| loadFilteredPath | back to summary |
|---|---|
| private void loadFilteredPath(String filter) | |
| setMainClass | back to summary |
|---|---|
| public void setMainClass(String classname) Sets the main class. If there is already a main class
it is overwritten. Calling
| |
| setRequireMain | back to summary |
|---|---|
| public void setRequireMain(boolean requireMain) Determines if a main class is required when calling.
| |