@azure/storage-file-share 12.11.1-alpha.20220923.1 → 12.11.1-alpha.20221013.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { SpanStatusCode } from "@azure/core-tracing";
6
6
  import { Share, Directory, File } from "./generated/src/operations";
7
7
  import { newPipeline, Pipeline } from "./Pipeline";
8
8
  import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants, FileAttributesPreserve, FileAttributesNone, } from "./utils/constants";
9
- import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, } from "./utils/utils.common";
9
+ import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, } from "./utils/utils.common";
10
10
  import { Credential } from "./credentials/Credential";
11
11
  import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential";
12
12
  import { AnonymousCredential } from "./credentials/AnonymousCredential";
@@ -162,7 +162,7 @@ export class ShareClient extends StorageClient {
162
162
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
163
163
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
164
164
  getDirectoryClient(directoryName) {
165
- return new ShareDirectoryClient(appendToURLPath(this.url, encodeURIComponent(directoryName)), this.pipeline);
165
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline);
166
166
  }
167
167
  /**
168
168
  * Gets the directory client for the root directory of this share.
@@ -862,7 +862,7 @@ export class ShareDirectoryClient extends StorageClient {
862
862
  * ```
863
863
  */
864
864
  getDirectoryClient(subDirectoryName) {
865
- return new ShareDirectoryClient(appendToURLPath(this.url, encodeURIComponent(subDirectoryName)), this.pipeline);
865
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline);
866
866
  }
867
867
  /**
868
868
  * Creates a new subdirectory under this directory.
@@ -1007,7 +1007,7 @@ export class ShareDirectoryClient extends StorageClient {
1007
1007
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
1008
1008
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
1009
1009
  getFileClient(fileName) {
1010
- return new ShareFileClient(appendToURLPath(this.url, encodeURIComponent(fileName)), this.pipeline);
1010
+ return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline);
1011
1011
  }
1012
1012
  /**
1013
1013
  * Returns true if the specified directory exists; false otherwise.
@@ -1673,13 +1673,13 @@ export class ShareDirectoryClient extends StorageClient {
1673
1673
  const split = destinationPath.split("?");
1674
1674
  let destinationUrl;
1675
1675
  if (split.length === 2) {
1676
- const pathOnly = encodeURIComponent(split[0]);
1676
+ const pathOnly = EscapePath(split[0]);
1677
1677
  const renameDestination = `/${this.shareName}/${pathOnly}`;
1678
1678
  destinationUrl = setURLPath(this.url, renameDestination);
1679
1679
  destinationUrl = setURLQueries(destinationUrl, split[1]);
1680
1680
  }
1681
1681
  else if (split.length === 1) {
1682
- const pathOnly = encodeURIComponent(destinationPath);
1682
+ const pathOnly = EscapePath(destinationPath);
1683
1683
  const renameDestination = `/${this.shareName}/${pathOnly}`;
1684
1684
  destinationUrl = setURLPath(this.url, renameDestination);
1685
1685
  }
@@ -3081,13 +3081,13 @@ export class ShareFileClient extends StorageClient {
3081
3081
  const split = destinationPath.split("?");
3082
3082
  let destinationUrl;
3083
3083
  if (split.length === 2) {
3084
- const pathOnly = encodeURIComponent(split[0]);
3084
+ const pathOnly = EscapePath(split[0]);
3085
3085
  const renameDestination = `/${this.shareName}/${pathOnly}`;
3086
3086
  destinationUrl = setURLPath(this.url, renameDestination);
3087
3087
  destinationUrl = setURLQueries(destinationUrl, split[1]);
3088
3088
  }
3089
3089
  else if (split.length === 1) {
3090
- const pathOnly = encodeURIComponent(destinationPath);
3090
+ const pathOnly = EscapePath(destinationPath);
3091
3091
  const renameDestination = `/${this.shareName}/${pathOnly}`;
3092
3092
  destinationUrl = setURLPath(this.url, renameDestination);
3093
3093
  }