|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.config.source.URLConfigSource
public class URLConfigSource
Accesses a (possibly) remote resource that is been specified via a URL and parses it into a collection of property values. Instances of this class are not safe for concurrent use. Wrap instances in a SynchronousConfigSource if thread safety is required.
| Constructor Summary | |
|---|---|
URLConfigSource(java.net.URL url)
Constructs a source which reads its properties from a URL using a DefaultPropertiesReader. |
|
URLConfigSource(java.net.URL url,
PropertiesReader reader)
Constructs a source which reads its properties from a URL using the supplied properties reader. |
|
| Method Summary | |
|---|---|
protected java.net.URLConnection |
connectToURL()
This method is responsible for obtaining a connection to the URL for this source, configuring it, calling the connect() method on it and then returning the connection. |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
A map of the configuration properties supplied by this source. |
PropertiesReader |
getReader()
The reader which converts this source's resources into properties. |
java.net.URL |
getURL()
The URL from which the properties are loaded. |
long |
lastModified()
Returns the time at which the properties were last known to have changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public URLConfigSource(java.net.URL url)
url - the location of the resource which contains the properties to
be loaded, not null
public URLConfigSource(java.net.URL url,
PropertiesReader reader)
url - the location of the resource which contains the properties to
be loaded, not nullreader - a properties reader which can convert the resource into a set
of properties, may be null| Method Detail |
|---|
public java.net.URL getURL()
public PropertiesReader getReader()
public long lastModified()
throws java.lang.RuntimeException
ConfigSource
lastModified in interface ConfigSourcejava.lang.RuntimeException - if an IOException was raised when accessing the resource
public java.util.Map<java.lang.String,java.lang.String> getProperties()
throws java.lang.RuntimeException
ConfigSource
getProperties in interface ConfigSourcejava.lang.RuntimeException - if an IOException was raised when accessing the resource
protected java.net.URLConnection connectToURL()
throws java.io.IOException
URLConnection
java.io.IOException - if the connection raises an IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||