|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.ci.config.load.LocationManager
public final class LocationManager
Manages locations to look for configuration files to load.
Constructor Summary | |
---|---|
LocationManager() Convenience constructor if no class loader should be used as a parent. |
|
LocationManager(ClassLoader parentClassLoader) Default constructor. |
Method Summary | |
---|---|
void |
addLocation(File file) Adds a file location to the manager to search for configuration files. |
void |
addLocation(URL url) Adds an URL location to the manager to search for configuration files. |
InputSource |
open(String resource) Opens a stream to the given resource, if the resource can be found at any location managed by this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocationManager()
public LocationManager(ClassLoader parentClassLoader)
parentClassLoader
- the parent class loader to delegate requests to. May be
null
.
Method Detail |
---|
public void addLocation(File file) throws NullPointerException, IllegalArgumentException
file
- the file location to be added. May reference a folder or a JAR file.
NullPointerException
- if
file
is
null
.
IllegalArgumentException
- if
file
does not provide a valid URL.
public void addLocation(URL url)
url
- the URL location to be added. May reference a folder or a JAR file.
public InputSource open(String resource) throws FileNotFoundException
The client is responsible to close the resource.
resource
- the resource to open.
FileNotFoundException
- if the resource cannot be opened.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |