public interface OsConfigurationService
This service can be used to provide different system specific implementations (of e.g. an executable) and pick the correct location to use.
The directory structure within the specified rootFolder respectively the structure of property keys
must be as follows:
root
|
|-- windows
| |
| |-- i386
| |
| |-- amd64
|
|-- linux
| |
| |-- i386
| |
| |-- x86_64
|
|-- mac_os
|
|-- amd64
Note, that the matching to the directories are done by a string distance algorithm or other fuzzy stuff to increase fault tolerance on various system/JVM combinations.
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
retrieveOsConfigurationKey(java.lang.String prefix)
Retrieves the best available configuration/property key for the given prefix.
|
java.io.File |
retrieveOsDirectory(java.io.File rootDirectory)
Evaluates the directory structure of the given
rootDirectory and return the best matching
os specific folder. |
java.lang.String |
retrieveOsSpecificProperty(java.lang.String prefix,
java.lang.String defaultValue)
Retrieves the best available configuration/property value instead of just retrieving the best matching key.
|
java.io.File retrieveOsDirectory(java.io.File rootDirectory)
rootDirectory and return the best matching
os specific folder.rootDirectory - the base directory containing the two level folder hierarchy of
os.name/os.archSystem.getProperties()java.lang.String retrieveOsConfigurationKey(java.lang.String prefix)
throws NoSuchConfigurationKeyException
retrieveOsDirectory(File), but operates on the
ConfigurationService properties instead of file
system directories.prefix - the common prefix of all property keys to obeyNoSuchConfigurationKeyException - if no configuration keys for the given prefix existretrieveOsDirectory(File)java.lang.String retrieveOsSpecificProperty(java.lang.String prefix,
java.lang.String defaultValue)
prefix - the common prefix of all property keys to obeydefaultValue - the default value to return is no such property existsdefaultValue if no such key exists.retrieveOsConfigurationKey(String)Copyright © 2018 SAP SE. All Rights Reserved.