FileConfigurationProvider
open class FileConfigurationProvider : ConfigurationProviding
Built-in configuration provider that obtains data from values in the application’s property list file. By default, configuration data will be read from ConfigurationProvider.plist
. Alternatively, you can specify your own property list file by passing the name (sans extension) for the configurationFilename
parameter when calling init(_:)
.
-
A read-only property for filename supplied during
init(_:)
.Declaration
Swift
public var filename: String { get }
-
Default class initializer.
Declaration
Swift
public init(_ configurationFilename: String = "ConfigurationProvider")
Parameters
configurationFilename
Optional. Used to supply a file name for a property list file. Do not include the extension (
.plist
). If this parameter is not supplied, the default file to read for configuration data will beConfigurationProvider.plist
.
-
A read-only property. The value for this class is
com.sap.configuration.provider.fileconfiguration
.Declaration
Swift
public var providerIdentifier: String { get }
-
Reports what input(s) are required for operation. The value for this class is an empty
Dictionary
(no inputs expected) since the filename may be optionally supplied during object instantiation.Declaration
Swift
public var expectedInput: [String : Any] { get }
-
Attempts to read data from the property list file supplied during
init(_:)
.Declaration
Swift
public func provideConfiguration(input: [String : Any] = [:]) -> (providerSuccess: Bool, configuration: NSDictionary, returnError: Error?)
Parameters
input
Data supplied by app in response to
expectedInput
dictionary. Since filename is optionally supplied during object instantiation, no additional input is required, so input dictionary in protocol is unused.Return Value
A tuple consisting of
providerSuccess
(success/fail result),configuration
if available, andreturnError
if applicable.