The V1ProfileRead class is for reading V1 profiles from disk. V1 profiles are not supported as of Zowe V3. Profiles should only be read for the purpose of converting the V1 profiles to a current zowe client configuration. All "fs" calls are wrapped here and errors are transformed to ImperativeError for error handling/flow throughout Imperative.

export
internal

### Hierarchy

- V1ProfileRead

## Index

### Properties

- ERROR_ID

### Methods

- crashInTeamConfigMode
- fileToProfileName
- getAllProfileDirectories
- getAllProfileNames
- readMetaFile
- readProfileFile

## Properties

### Static Private ERROR_ID

ERROR_ID: string = "V1ProfileRead Read Error"

- Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:187

Error IO tag for Imperative Errors

static
memberof

  V1ProfileRead

## Methods

### Static Private crashInTeamConfigMode

- crashInTeamConfigMode(): void

- - Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:152

  Crash if we detect that we are running in team-config mode. You should not be able to operate on old-school profiles when you are in team-config mode. Give a meaningful message as part of our crash.

  #### Returns void

### Static Private fileToProfileName

- fileToProfileName(file: string, ext: string): string

- - Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:175

  Extracts the profile name from the file path/name

  static
  memberof

    V1ProfileRead

  #### Parameters

  - ##### file: string

    the file path to extract the profile name

  - ##### ext: string

    the extension of the file

  #### Returns string

  - the profile name

### Static getAllProfileDirectories

- getAllProfileDirectories(profileRootDirectory: string): string[]

- - Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:67

  Accepts the profiles root directory and returns all directories within. The directories within the root directory are all assumed to be profile type directories (potentially containing a meta file and profiles of that type).

  static
  memberof

    V1ProfileRead

  #### Parameters

  - ##### profileRootDirectory: string

    The profiles root directory to obtain all profiles from.

  #### Returns string[]

  - The list of profiles returned or a blank array

### Static getAllProfileNames

- getAllProfileNames(profileTypeDir: string, ext: string, metaNameForType: string): string[]

- - Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:98

  Accepts the profile directory location for a type, reads all filenames, and returns a list of profile names that are present within the directory (excluding the meta profile)

  static
  memberof

    V1ProfileRead

  #### Parameters

  - ##### profileTypeDir: string

    The directory for the type

  - ##### ext: string

    the extension for the profile files (normally YAML)

  - ##### metaNameForType: string

    the meta name for this type

  #### Returns string[]

  - A list of all profile names (without path/ext)

### Static readMetaFile

- readMetaFile<T>(path: string): IMetaProfile<T>

- - Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:43

  Read the profile meta file using Yaml "safeLoad" (ensures that no code executes, etc. during the load). The meta profile file for a type contains the default profile specification. The meta profile is ALWAYS in YAML format (controlled exclusively by the Imperative framework).

  static
  memberof

    V1ProfileRead

  #### Type parameters

  - #### T: IProfileTypeConfiguration

  #### Parameters

  - ##### path: string

    The path to the meta profile

  #### Returns IMetaProfile<T>

  - The meta profile

### Static readProfileFile

- readProfileFile(filePath: string, _type: string): IProfile

- - Defined in @zowe/imperative/src/profiles/src/utils/V1ProfileRead.ts:131

  Read a profile from disk. Profiles are always assumed to be YAML (YAML "safeLoad" is invoked to perform the load).

  static
  memberof

    V1ProfileRead

  #### Parameters

  - ##### filePath: string

    Path to the profile.

  - ##### _type: string

  #### Returns IProfile

  - The profile object.

Generated using TypeDoc