Package net.obvj.confectory.source
Class URLSource<T>
- java.lang.Object
-
- net.obvj.confectory.source.AbstractSource<T>
-
- net.obvj.confectory.source.URLSource<T>
-
- All Implemented Interfaces:
Source<T>
- Direct Known Subclasses:
ClasspathFileSource
public class URLSource<T> extends AbstractSource<T> implements Source<T>
A specialized configuration source implementation that loads contents from a URL, that can be a local file or a Web resource.The syntax of a URL is defined by RFC-2396 (Uniform Resource Identifiers: Generic Syntax), and amended by RFC-2732 (Format for Literal IPv6 Addresses in URLs).
Examples of valid URLs:
file:///etc/fstab(local host)file://ftp.server.com/pub/files/foo.xmlhttp://www.server.com:1080/myservice/config.jsonhttp://192.168.0.10:1080/config?field1=value1&field2=value2
- Since:
- 0.4.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tload(Mapper<T> mapper)Applies a specific configuration loading strategy and returns a mapped bean containing the retrieved data, throwing an exception if the operation fails.-
Methods inherited from class net.obvj.confectory.source.AbstractSource
equals, hashCode, load, toString
-
-
-
-
Constructor Detail
-
URLSource
public URLSource(String string)
Builds a new configuration source for a specific URL.- Parameters:
string- the string to parse as URL for this configuration source- Throws:
ConfigurationSourceException- if the specified URL can not be parsed
-
-