### Hierarchy

- Upload

## Index

### Accessors

- log

### Methods

- bufferToDataSet
- bufferToUssFile
- dirToPds
- dirToUSSDir
- dirToUSSDirRecursive
- fileToDataset
- fileToUssFile
- formatStringForDisplay
- generateHeadersBasedOnOptions
- getDirs
- hasDirs
- isDirectoryExist
- pathToDataSet
- streamToDataSet
- streamToUssFile
- uploadFile

## Accessors

### Static Private log

- get log(): Logger

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:923

  Get Log

  #### Returns Logger

  applicationLogger.

## Methods

### Static bufferToDataSet

- bufferToDataSet(session: AbstractSession, fileBuffer: Buffer, dataSetName: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:152

  Writing data buffer to a data set.

  throws

    {ImperativeError} When encounter error scenarios.

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### fileBuffer: Buffer

    Data buffer to be written

  - ##### dataSetName: string

    Name of the data set to write to

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the outcome

### Static bufferToUssFile

- bufferToUssFile(session: AbstractSession, ussname: string, fileBuffer: Buffer, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:464

  Upload content to USS file

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### ussname: string

    Name of the USS file to write to

  - ##### fileBuffer: Buffer

    Data to be written

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

### Static dirToPds

- dirToPds(session: AbstractSession, inputDir: string, dataSetName: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:98

  Upload content from a directory to a PDS

  throws

    {ImperativeError} When encounter error scenarios.

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### inputDir: string

    path to a file

  - ##### dataSetName: string

    Name of the data set to write to

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the out come

### Static dirToUSSDir

- dirToUSSDir(session: AbstractSession, inputDirectory: string, ussname: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:652

  Upload local directory to USS directory

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### inputDirectory: string

    the path of local directory

  - ##### ussname: string

    the name of uss folder

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

### Static dirToUSSDirRecursive

- dirToUSSDirRecursive(session: AbstractSession, inputDirectory: string, ussname: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:771

  Upload directory to USS recursively

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### inputDirectory: string

    the path of local directory

  - ##### ussname: string

    the name of uss folder

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

### Static fileToDataset

- fileToDataset(session: AbstractSession, inputFile: string, dataSetName: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:49

  Upload content from file to data set

  throws

    {ImperativeError} When encounter error scenarios.

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### inputFile: string

    path to a file

  - ##### dataSetName: string

    Name of the data set to write to

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the out come

### Static fileToUssFile

- fileToUssFile(session: AbstractSession, inputFile: string, ussname: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:590

  Upload content from a local file to remote USS file

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### inputFile: string

    Path to local file

  - ##### ussname: string

    Name of USS file to write to

  - ##### Default value options: IUploadOptions = {}

    Uploading options

  #### Returns Promise<IZosFilesResponse>

  - A response indicating the outcome

### Static Private formatStringForDisplay

- formatStringForDisplay(stringInput: string): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:964

  helper function to prepare file names for display on progress bar

  #### Parameters

  - ##### stringInput: string

    string input to be formated

  #### Returns string

### Static Private generateHeadersBasedOnOptions

- generateHeadersBasedOnOptions(options: IUploadOptions, context?: string): IHeaderContent[]

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:977

  helper function to generate the headers based on the options used

  #### Parameters

  - ##### options: IUploadOptions

    upload options

  - ##### Optional context: string

    context method from where you call this function (can be "buffer", "stream" or undefined)

  #### Returns IHeaderContent[]

### Static Private getDirs

- getDirs(dirPath: string): IUploadDir[]

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:945

  Returns an array of sub-directories objects, containing directory name, and full path specification

  #### Parameters

  - ##### dirPath: string

    full-path for the directory to check

  #### Returns IUploadDir[]

### Static Private hasDirs

- hasDirs(dirPath: string): boolean

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:932

  Checks if a given directory has sub-directories or not

  #### Parameters

  - ##### dirPath: string

    full-path for the directory to check

  #### Returns boolean

### Static isDirectoryExist

- isDirectoryExist(session: AbstractSession, ussname: string): Promise<boolean>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:746

  Check if USS directory exists

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### ussname: string

    the name of uss folder

  #### Returns Promise<boolean>

### Static pathToDataSet

- pathToDataSet(session: AbstractSession, inputPath: string, dataSetName: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:295

  Upload content from input path to dataSet or PDS members

  throws

    {ImperativeError} When encounter error scenarios.

  example

    pathToDataSet(session, "file.txt", "ps.name")

  example

    pathToDataset(session, "file.txt", "psd.name(member)")

  example

    pathToDataSet(session, "directory", "pds.name")

  example

    pathToDataset(session, "/full/path/file.txt", "ps.name")

    Note: This method does everything needed to do from checking if path is file or directory and if data set is sequential file or PDS to determine what name to be used when upload content to data set. All you have to specify is a directory and a dsname.

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### inputPath: string

    User input path to file or directory

  - ##### dataSetName: string

    Name of the data set to write to

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the out come

### Static streamToDataSet

- streamToDataSet(session: AbstractSession, fileStream: Readable, dataSetName: string, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:222

  Writing data buffer to a data set.

  throws

    {ImperativeError} When encounter error scenarios.

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### fileStream: Readable

  - ##### dataSetName: string

    Name of the data set to write to

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the out come

### Static streamToUssFile

- streamToUssFile(session: AbstractSession, ussname: string, uploadStream: Readable, options?: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:533

  Upload content to USS file

  #### Parameters

  - ##### session: AbstractSession

    z/OS connection info

  - ##### ussname: string

    Name of the USS file to write to

  - ##### uploadStream: Readable

    Data to be written

  - ##### Default value options: IUploadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  - A response indicating the outcome

### Static uploadFile

- uploadFile(session: AbstractSession, localPath: string, ussPath: string, options: IUploadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/upload/Upload.ts:889

  #### Parameters

  - ##### session: AbstractSession

  - ##### localPath: string

  - ##### ussPath: string

  - ##### options: IUploadOptions

  #### Returns Promise<IZosFilesResponse>

Generated using TypeDoc