public class ConfigLoader extends Object
| Constructor and Description |
|---|
ConfigLoader(com.google.common.base.Optional<String> env) |
| Modifier and Type | Method and Description |
|---|---|
ConfigSupplier |
fromFile(String path)
Provides a ConfigSupplier loading config from a file.
|
ConfigSupplier |
fromResource(String resource)
Provides a ConfigSupplier loading config from a classpath resource.
|
protected void |
loadAllFromFile(List<ConfigElement> elements,
String path) |
protected void |
loadAllFromResource(List<ConfigElement> elements,
String resource) |
protected void |
loadFileInto(java.nio.file.Path path,
List<ConfigElement> elements) |
protected void |
loadResourceInto(String name,
List<ConfigElement> elements) |
String |
locationKeyForResource(String resource)
Gives the name of the system property that can be used to provide a file location
to load to override settings for a particular resource.
|
public ConfigLoader(com.google.common.base.Optional<String> env)
public ConfigSupplier fromResource(String resource)
resource - the path of the resource to load, without extension.public ConfigSupplier fromFile(String path)
path - the path of the file to load config from.public String locationKeyForResource(String resource)
resource - the resource for which the system property name should be provided.protected void loadAllFromResource(List<ConfigElement> elements, String resource)
protected void loadAllFromFile(List<ConfigElement> elements, String path)
protected void loadFileInto(java.nio.file.Path path, List<ConfigElement> elements)
protected void loadResourceInto(String name, List<ConfigElement> elements)
Copyright © 2017. All Rights Reserved.