Class ConfigFileReader
Simple implementation to read OCI configuration file.
Inherited Members
Namespace: Oci.Common
Assembly: OCI.DotNetSDK.Common.dll
Syntax
public class ConfigFileReader
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 |
---|---|
string |
DEFAULT_FILE_PATH
Default location of the config file.
Declaration
public static readonly string DEFAULT_FILE_PATH
Field Value
Type | Description |
---|---|
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 |
---|---|
string |
logger
Declaration
protected static Logger logger
Field Value
Type | Description |
---|---|
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. |
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 |
---|---|---|
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 |
---|---|---|
string | configurationFilePath | The path to the config file. |
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 |
---|---|---|
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. |