예제 #1
0
 internal BlobContainer(string containerName, string id, IBlobServiceClient blobServiceClient)
 {
     Utility.AssertNotNullOrEmpty(nameof(containerName), containerName);
     Utility.AssertNotNullOrEmpty(nameof(id), id);
     this.Name          = containerName;
     this.ServiceClient = blobServiceClient;
     this.Id            = id;
     _containersApi     = ((BlobServiceClient)blobServiceClient).ContainersApiClient;
 }
예제 #2
0
        internal Blob(IBlobServiceClient client, BlobContainer container, string blobId,
                      string filename, string mimeType, long sizeInBytes, Uri downloadUrl)
        {
            Utility.AssertNotNull(nameof(client), client);
            Utility.AssertNotNull(nameof(container), container);
            Utility.AssertNotNullOrEmpty(nameof(blobId), blobId);
            Utility.AssertNotNullOrEmpty(nameof(filename), filename);
            Utility.AssertNotNullOrEmpty(nameof(mimeType), mimeType);
            Utility.AssertNotNull(nameof(downloadUrl), downloadUrl);

            this.ServiceClient = client;
            this.Id            = blobId;
            this.Container     = container;
            this.FileName      = filename;
            this.MimeType      = mimeType;
            this.SizeInBytes   = sizeInBytes;
            this.DownloadUrl   = downloadUrl;

            this._blobApi     = ((BlobServiceClient)ServiceClient).BlobsApiClient;
            this._metaDataApi = ((BlobServiceClient)ServiceClient).MetaDatasApiClient;
        }
예제 #3
0
 private static async Task <LeaseBlobAcquireResponse> LeaseExistingBlockBlob(IBlobServiceClient blobServiceClient, string containerName, string blobName, int leaseDuration, string proposedLeaseId)
 {
     return(await blobServiceClient.LeaseBlobAcquireAsync(containerName, blobName, leaseDuration, proposedLeaseId ?? Guid.NewGuid().ToString()));
 }