Package io.github.qubitpi.athena.config
Class ConfigResourceLoader
java.lang.Object
io.github.qubitpi.athena.config.ConfigResourceLoader
Utilities to help load resources for the
SystemConfig
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ConfigResourceLoader
Singleton factory method.@NotNull List<org.apache.commons.configuration2.Configuration>
loadConfigurations
(@NotNull String name) Load configurations matching a resource name from the class path and parse into Configuration objects.
-
Constructor Details
-
ConfigResourceLoader
public ConfigResourceLoader()
-
-
Method Details
-
getInstance
Singleton factory method.- Returns:
- a new instance
-
loadConfigurations
@NotNull public @NotNull List<org.apache.commons.configuration2.Configuration> loadConfigurations(@NotNull @NotNull String name) throws IOException Load configurations matching a resource name from the class path and parse into Configuration objects.- Parameters:
name
- The class path address of a resource ('/foo' means a resource named "foo" under resource/ directory)- Returns:
- a list of configurations corresponding to the matching class path resource
- Throws:
NullPointerException
- ifname
isnull
IOException
- if any resource cannot be read from the class path successfully
-