Class Resources
Object
Resources
Accesses resource-files associated with this application.
When specifying paths to resources, one should avoid a leading / on the resource path as it
uses a ClassLoader
to load resources, which is different behavior to
getClass().getResourceAsStream()
.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFooter-message used after "show tasks".Footer-message that describes usage.Header-message that describes usage.Footer-message that accompanies a version message, if it exists.Gets the current version of the software by reading a properties-file provided by the Maven build
-
Constructor Details
-
Resources
public Resources(ClassLoader classLoader, String pathVersionFooter, String pathMavenProperties, String pathUsageHeader, String pathUsageFooter, Optional<String> pathTasksFooter) Creates a newResources
instance.- Parameters:
classLoader
- Which class-loader to use for loading resources.pathVersionFooter
- Path to the footer-message that accompanies a version message.pathMavenProperties
- Path to the maven-properties file (from which a version can be extracted).pathUsageHeader
- Path to the header-message that describes usage.pathUsageFooter
- Path to the footer-message that describes usage.pathTasksFooter
- Path to the footer-message used after "show tasks"
-
-
Method Details
-
usageHeader
Header-message that describes usage.- Returns:
- the message
-
versionFromMavenProperties
Gets the current version of the software by reading a properties-file provided by the Maven buildNOTE that this pom.proper
- Returns:
- string describing the current version number of anchor-launcher
- Throws:
IOException
- if the properties file cannot be read, or is missing the appropriate version key
-