Class FileContentResolver
java.lang.Object
org.forgerock.opendj.config.server.FileContentResolver
- All Implemented Interfaces:
PropertyResolver
Property resolver that considers only the property keys that begins with the "file:" string, and
then interprets the remaining part of the key as a relative or absolute file path that must be read
to return a value.
Example: a call to resolver.getProperty("&{file:/some/path}") will return the content of
the /some/path file, provided it exists and is not empty.
If the key does not correspond to an existing non-empty file, or if an error occurs during
the reading of the file, then an IllegalStateException is thrown.
-
Constructor Summary
ConstructorsConstructorDescriptionFileContentResolver(Path serverInstancePath) Creates a file content resolver. -
Method Summary
Modifier and TypeMethodDescriptiongetProperty(String key, boolean sensitive) Returns the value of the specified property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.forgerock.config.resolvers.PropertyResolver
getProperty, getProperty, getProperty
-
Constructor Details
-
FileContentResolver
Creates a file content resolver.- Parameters:
serverInstancePath- Path to server instance
-
-
Method Details
-
getProperty
Description copied from interface:PropertyResolverReturns the value of the specified property. The method returns an emptyOptionalif the property is not found. The resolved property has to be considered sensitive ifsensitiveistrueand implementations are required to handle it with special attention (no logs, ...).- Specified by:
getPropertyin interfacePropertyResolver- Parameters:
key- The name of the requested property. The key can't be null.sensitive-trueis the property value has to be considered a sensitive value (such as a password).- Returns:
- An
Optionalstring that contains the value of the requested property, or emptyOptionalif property is undefined.
-