Common IO utilities

### Hierarchy

- ZosFilesUtils

## Index

### Properties

- DEFAULT_FILE_EXTENSION
- DSN_SEP
- MAX_MEMBER_LENGTH

### Methods

- dfsmsHsmCommand
- formatUnixFilepath
- generateHeadersBasedOnOptions
- generateMemberName
- getDataSetFromName
- getDirsFromDataSet
- getFileListFromPath
- getFullPath
- isDataSetNameContainMasking
- normalizeNewline
- sanitizeUssPathForRestCall

## Properties

### Static Readonly DEFAULT_FILE_EXTENSION

DEFAULT_FILE_EXTENSION: string = "txt"

- Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:37

Default file extension

### Static Readonly DSN_SEP

DSN_SEP: string = "."

- Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:31

Data set name qualifier separator

### Static Readonly MAX_MEMBER_LENGTH

MAX_MEMBER_LENGTH: number = 8

- Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:39

## Methods

### Static dfsmsHsmCommand

- dfsmsHsmCommand(session: AbstractSession, dataSetName: string, returnMessage: string, hsmCommand: any, options?: Partial<IDeleteOptions>): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:233

  #### Parameters

  - ##### session: AbstractSession

    z/OSMF connection info

  - ##### dataSetName: string

    -The name of the data set to recall|migrate|delete

  - ##### returnMessage: string

    Message to return based upon command request

  - ##### hsmCommand: any

    HsmCommand requested

  - ##### Default value options: Partial<IDeleteOptions> = {}

    - - If true then the function waits for completion of the request. If false (default) the request is queued.

  #### Returns Promise<IZosFilesResponse>

### Static formatUnixFilepath

- formatUnixFilepath(usspath: string): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:217

  Format USS filepaths in the way that the APIs expect (no leading /)

  #### Parameters

  - ##### usspath: string

    the path to format

  #### Returns string

### Static Private generateHeadersBasedOnOptions

- generateHeadersBasedOnOptions(options: IOptions): IHeaderContent[]

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:124

  Common method to build headers given input options object

  static
  memberof

    ZosFilesUtils

  #### Parameters

  - ##### options: IOptions

    various options

  #### Returns IHeaderContent[]

### Static generateMemberName

- generateMemberName(fileName: string): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:161

  Generate member name from input string base on IBM specification

  #### Parameters

  - ##### fileName: string

    input name used to generate member name with

  #### Returns string

  generated member name

### Static getDataSetFromName

- getDataSetFromName(name: string): IDataSet

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:284

  Converts the name of a data set to an IDataSet

  #### Parameters

  - ##### name: string

    the name in the form USER.DATA.SET | USER.DATA.SET(mem1)

  #### Returns IDataSet

### Static getDirsFromDataSet

- getDirsFromDataSet(dataSet: string): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:48

  Break up a dataset name of either: USER.WORK.JCL(TEMPLATE) to user/work/jcl/template Or: USER.WORK.PS to user/work/ps

  #### Parameters

  - ##### dataSet: string

    data set to break up into folders

  #### Returns string

### Static getFileListFromPath

- getFileListFromPath(inputPath: string, inFullPathFormat?: boolean, isIgnoreHidden?: boolean): string[]

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:83

  Return an array contain the list of all files in the input path. It does not trevor to directory in the input path.

  #### Parameters

  - ##### inputPath: string

    input path to gather file list

  - ##### Default value inFullPathFormat: boolean = true

  - ##### Default value isIgnoreHidden: boolean = true

  #### Returns string[]

  Array of all files finds in path

### Static getFullPath

- getFullPath(inputPath: string): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:63

  Get fullpath name from input path.

  #### Parameters

  - ##### inputPath: string

    input path

  #### Returns string

  full path version of the input path

### Static isDataSetNameContainMasking

- isDataSetNameContainMasking(dataSetName: string): boolean

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:184

  Check if the input data set name contain masking characters

  #### Parameters

  - ##### dataSetName: string

    input data set name to be checked

  #### Returns boolean

  status if data set name contain masking characters

### Static normalizeNewline

- normalizeNewline(buffer: Buffer): Buffer

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:199

  Normalize all Windows newline to Unix newline

  #### Parameters

  - ##### buffer: Buffer

    data to convert

  #### Returns Buffer

  converted data

### Static sanitizeUssPathForRestCall

- sanitizeUssPathForRestCall(ussPath: string): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/utils/ZosFilesUtils.ts:207

  Normanize and URL-encode a USS path to be passed to z/OSMF

  #### Parameters

  - ##### ussPath: string

    path to sanitize

  #### Returns string

Generated using TypeDoc