Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog fix #2331

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- Enhancement: Added support for running applications on TSO/E address spaces. Applications can be started, receive messages and transmit messages [#2280](https://github.com/zowe/zowe-cli/pull/2280)

## `8.4.0`

- Enhancement: Added optional `--attributes` flag to `zowe zos-files upload file-to-uss` to allow passing a .zosattributes file path for upload encoding format. [#2319] (https://github.com/zowe/zowe-cli/pull/2319)
- Enhancement: Added optional `--attributes` flag to `zowe zos-files upload file-to-uss` to allow passing a .zosattributes file path for upload encoding format. [#2319](https://github.com/zowe/zowe-cli/pull/2319)

## `8.3.0`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const UssFileDefinition: ICommandDefinition = {
}
],
options: [
DownloadOptions.attributes,
DownloadOptions.file,
DownloadOptions.binary,
DownloadOptions.encoding
Expand Down
17 changes: 13 additions & 4 deletions packages/cli/src/zosfiles/download/uss/UssFile.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

import { ZosFilesBaseHandler } from "../../ZosFilesBase.handler";
import { AbstractSession, IHandlerParameters, ITaskWithStatus, TaskStage } from "@zowe/imperative";
import { Download, IZosFilesResponse } from "@zowe/zos-files-for-zowe-sdk";
import { Download, IDownloadOptions, IZosFilesResponse, ZosFilesAttributes } from "@zowe/zos-files-for-zowe-sdk";
import { UploadOptions } from "../../upload/Upload.options";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import UploadOptions.

/**
* Handler to download an uss file
Expand All @@ -25,13 +26,21 @@
stageName: TaskStage.IN_PROGRESS
};
commandParameters.response.progress.startBar({task});
return Download.ussFile(session, commandParameters.arguments.ussFileName, {

const downloadOptions: IDownloadOptions = {
binary: commandParameters.arguments.binary,
encoding: commandParameters.arguments.encoding,
file: commandParameters.arguments.file,
task,
responseTimeout: commandParameters.arguments.responseTimeout,
overwrite: commandParameters.arguments.overwrite
});
overwrite: commandParameters.arguments.overwrite,
};
const attributes = ZosFilesAttributes.loadFromFile(
commandParameters.arguments.attributes,
);
if (attributes != null) {
downloadOptions.attributes = attributes;
}
return Download.ussFile(session, commandParameters.arguments.ussFileName, downloadOptions);
}
}
5 changes: 5 additions & 0 deletions packages/zosfiles/src/doc/IOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import { ITaskWithStatus } from "@zowe/imperative";
import { IZosFilesOptions } from "./IZosFilesOptions";
import { ZosFilesAttributes } from "../utils/ZosFilesAttributes";

/**
* This interface defines the options that can be sent to get a data set or USS file function
Expand Down Expand Up @@ -57,4 +58,8 @@ export interface IOptions extends IZosFilesOptions {
* @type {ITaskWithStatus}
*/
task?: ITaskWithStatus;
/**
* The path to a .zosattributes file used to control file conversion and tagging.
*/
attributes?: ZosFilesAttributes;
}
2 changes: 2 additions & 0 deletions packages/zosfiles/src/methods/download/Download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@
ussFileName = ZosFilesUtils.sanitizeUssPathForRestCall(ussFileName);
const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, ussFileName);

options.encoding = options.attributes.getRemoteEncoding(ussFileName)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (95% of all statements in
the enclosing function
have an explicit semicolon).

const reqHeaders: IHeaderContent[] = this.generateHeadersBasedOnOptions(options);

// Use specific options to mimic ZosmfRestClient.getStreamed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ export interface IDownloadSingleOptions extends IGetOptions {
overwrite?: boolean;

/**
* Optional stream to read the file contents
* Optional stream to write the file contents
*/
stream?: Writable;
/**
* The ZosFilesAttributes instance describe upload attributes for the files and directories
*/
attributes?: ZosFilesAttributes;
}

/**
Expand Down
Empty file added usstest.txt
Empty file.
Loading