Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConfigFileReader

Hierarchy

  • ConfigFileReader

Properties

Static DEFAULT_FILE_PATH

DEFAULT_FILE_PATH: string = "~/.oci/config"

Default location of the config file.

Static DEFAULT_PROFILE_NAME

DEFAULT_PROFILE_NAME: string = "DEFAULT"

Static FALLBACK_DEFAULT_FILE_PATH

FALLBACK_DEFAULT_FILE_PATH: string = "~/.oraclebmc/config"

The fallback default location of the config file. If and only if the DEFAULT_FILE_PATH does not exist, this fallback default location will be used.

Methods

Static correctPath

  • correctPath(isWindows: boolean, path: string): string

Static expandUserHome

  • expandUserHome(path: string): string

Static fileExists

  • fileExists(filepath: string): boolean

Static parse

  • parse(fileContent: string, profile: string | null): ConfigFile

Static parseDefault

  • parseDefault(profile: string | null): ConfigFile
  • Creates a new ConfigFile instance using the configuration at the default location, using the given profile.

    throws

    Error, if the file could not be read.

    Parameters

    • profile: string | null

      The profile name to load, or null if you want to load the "DEFAULT" profile.

    Returns ConfigFile

    A new ConfigFile instance.

Static parseFileFromPath

  • parseFileFromPath(path: string, profile: string | null): ConfigFile