Class ConfigFileReader
Simple implementation to read OCI configuration file.
Inheritance
Namespace: Oci.Common
Assembly: OCI.DotNetSDK.Common.dll
Syntax
public class ConfigFileReader : object
Fields
CONFIG_FILE_PATH_ENV_VAR_NAME
Environment variable name of the config file location.
Declaration
public static readonly string CONFIG_FILE_PATH_ENV_VAR_NAME
Field Value
Type | Description |
---|---|
System.String |
DEFAULT_FILE_PATH
Default location of the config file.
Declaration
public static readonly string DEFAULT_FILE_PATH
Field Value
Type | Description |
---|---|
System.String |
FALLBACK_DEFAULT_FILE_PATH
Fallback location of the config file. If and only if the DEFAULT_FILE_PATH does not exist and CONFIG_FILE_PATH_ENV_VAR_NAME is not set, this fallback location is used.
Declaration
public static readonly string FALLBACK_DEFAULT_FILE_PATH
Field Value
Type | Description |
---|---|
System.String |
logger
Declaration
protected static NLog.Logger logger
Field Value
Type | Description |
---|---|
NLog.Logger |
Methods
Parse(Stream, String)
Creates a new ConfigFile instance using an UTF-8 input stream, and the given profile.
Declaration
public static ConfigFile Parse(Stream configurationStream, string profile)
Parameters
Type | Name | Description |
---|---|---|
Stream | configurationStream | The config file. |
System.String | profile | The profile name to load, or null if you want to load the "DEFAULT" profile. |
Returns
Type | Description |
---|---|
ConfigFile | A new ConfigFile instance. |
Parse(String)
Creates a new ConfigFile instance using the configuration at the given location, using the DEFAULT profile.
Declaration
public static ConfigFile Parse(string configurationFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationFilePath | The path to the config file. |
Returns
Type | Description |
---|---|
ConfigFile | A new ConfigFile instance. |
Parse(String, String)
Creates a new ConfigFile instance using the configuration at the given location, using the given profile.
Declaration
public static ConfigFile Parse(string configurationFilePath, string profile)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationFilePath | The path to the config file. |
System.String | profile | The profile name to load, or null if you want to load the "DEFAULT" profile. |
Returns
Type | Description |
---|---|
ConfigFile | A new ConfigFile instance. |
ParseDefault()
Creates a new ConfigFile instance using the configuration at the default location, using the default profile.
Declaration
public static ConfigFile ParseDefault()
Returns
Type | Description |
---|---|
ConfigFile | A new ConfigFile instance. |
ParseDefault(String)
Creates a new ConfigFile instance using the configuration at the default location, using the given profile.
Declaration
public static ConfigFile ParseDefault(string profile)
Parameters
Type | Name | Description |
---|---|---|
System.String | profile | The profile name to load, or null if you want to load the "DEFAULT" profile. |
Returns
Type | Description |
---|---|
ConfigFile | A new ConfigFile instance. |