@azure/storage-file-share
Version:
Microsoft Azure Storage SDK for JavaScript - File
30 lines • 1.31 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageContextClient } from "./StorageContextClient";
import { getCoreClientOptions, getCredentialFromPipeline } from "./Pipeline";
import { escapeURLPath, getAccountNameFromUrl } from "./utils/utils.common";
/**
* A StorageClient represents a base client class for ServiceClient, ContainerClient and etc.
*/
export class StorageClient {
/**
* Creates an instance of StorageClient.
* @param url -
* @param pipeline -
*/
constructor(url, pipeline) {
// URL should be encoded and only once, protocol layer shouldn't encode URL again
this.url = escapeURLPath(url);
this.accountName = getAccountNameFromUrl(url);
this.pipeline = pipeline;
this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));
// Remove the default content-type in generated code of StorageClientContext
const storageClientContext = this.storageClientContext;
if (storageClientContext.requestContentType) {
storageClientContext.requestContentType = undefined;
}
const credential = getCredentialFromPipeline(pipeline);
this.credential = credential;
}
}
//# sourceMappingURL=StorageClient.js.map