DSAzure.TAzureBlobService.GetBlob

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetBlob(const ContainerName: String; const BlobName: String; ResponseContent: TStream; const Snapshot: String = ''; StartByte: int64 = 0;  EndByte: int64 = 0; const LeaseId: String = ''; GetMD5: boolean = false): boolean;

C++

bool __fastcall GetBlob(const System::UnicodeString ContainerName, const System::UnicodeString BlobName, System::Classes::TStream* ResponseContent, const System::UnicodeString Snapshot = System::UnicodeString(), __int64 StartByte = 0LL, __int64 EndByte = 0LL, const System::UnicodeString LeaseId = System::UnicodeString(), bool GetMD5 = false);

Properties

Type Visibility Source Unit Parent
function public
DSAzure.pas
DSAzure.hpp
DSAzure TAzureBlobService

Description

Downloads the given blob, writing its content into the provided stream.

GetBlob populates the BlobStream TStream with the content of the blob.

You can optionally specify StartByte and EndByte to refine the part of the content returned. If a byte-range is specified and GetMD5 is set to True, then the returned result is the MD5 hash of that range of bytes, the provided range is not too long.

Warning: When the range is too long, then the request fails.
Note: For more details, refer to the MSDN documentation in the See Also section.

Besides, there are 4 overloaded 'GetBlob methods:

  • The first GetBlob method downloads the given blob, writing its content into the provided stream.
  • The second overloaded method also returns the blob's properties and metadata.
  • Using the third overloaded method, you can request only a range of the blob to be returned by specifying values for StartByte and EndByte. If you specify a range, you can also set GetAsHash to True, which returns the MD5 hash of the range's content, instead of the content itself.
Note: You can only return the hash for a range, and not the full content.
  • The fourth overloaded method also returns the blob's properties and metadata. You can request only a range of the blob to be returned by specifying values for StartByte and EndByte, similarly to the third overloaded method.
Parameter Description

ContainerName

The name of the container the blob is in.

BlobName

The name of the blob to download.

BlobStream

The stream to write the blob content into.

StartByte

The starting byte index.

EndByte

The ending byte index, or 0 if you do not want a range of the blob.

GetAsHash

If True or if EndByte is greater than StartByte, the method returns content as MD5 hash.

Properties

The blob's property name/value pairs.

Metadata

The blob's metadata name/value pairs.

LeaseId

The lease ID, required if the blob is locked.

ResponseInfo

The optional class for storing response info into.

The method returns True if the task was successful, False otherwise.

See Also