A5Storage::DataContainer Class

Description

Used to access and manage data in a Storage container. A container can be an Azure Blob Storage account, an Amazon S3 Storage bucket, or a folder on disk located on the server or a machine on the same network as the server.

Discussion

An A5Storage::DataContainer acts as a reference point from which other objects can be accessed. An object is a file. Object references can include paths as part of the object name.

If a DataContainer references objects stored on disk, a path can be specified that defines the "root" path to other objects. The complete path to an object on disk is a combination of the Container path (defined as part of the connection string) and object name.

To create a A5Storage::DataContainer, use the A5Storage::DataContainer::Open static method.

Do not share A5Storage::DataContainer objects across threads! Connection strings and item names can be shared, but a new object must be created every time you want to access the Storage container. Many functions save the error state as a member variable (CallResult) and return a Boolean .T. or .F. to indicate success or failure. If an object is shared across threads, two different users may make overlapping calls, causing the CallResult to be overwritten.

Properties

CallResultCallResult

When using a static method, the CallResult property will hold information for the result of calling the static method.

ConnnectionPropertiesPointer

ConnectionProperties property

ConnectionStringCharacter

The Storage Connection String used to open the connection. E.g. "Provider='Disk';Container='C:\A5WebRoot';"

ExistsLogical

.T. if the container exists, otherwise .F.

NameCharacter

The name of the DataContainer. For example, for 'Disk' Storage container, the name may be "C:\A5WebRoot".

StorageTypeCharacter

The type of storage. Storage types include 'Azure', 'AmazonS3', and 'Disk'.

Methods

AddItemPermissions Method

AddItemPermissions

ClearTaskList Method

ClearTaskList

CompareSourceAndTargetObjectTimeStamps Method

CompareSourceAndTargetObjectTimeStamps

CopyContentsTo Method

Copies all items to another container. Any existing items in the destination container will be replaced.

CopyItemTo Method

Copies one item in a container to another container.

CopyNewContentsTo Method

Copies all objects that are newer to another container.

DecryptConnectionString Method

Decrypts a connection string that has been encrypted using a passphrase.

DeleteItem Method

Deletes an object in a container. If the object doesn't exist, no error is returned.

EncryptConnectionString Method

Encrypts a connection string using a passphrase. If no passphrase is provided, a default passphrase is used. Only the assembly that encrypted the connection string using the passphrase can decrypt the connection string.

GetContainerItemModifiedDate Method

GetContainerItemModifiedDate

GetItem Method

Retrieves an item from the container using the provided name. The content type is also returned.

ItemExists Method

ItemExists

ItemModifiedTime Method

ItemModifiedTime

ItemSize Method

ItemSize

ListItems Method

Generates a list of the items in the Container as a CR-LF delimited string.

Open Method

Open a connection to a storage location.

ReferenceItem Method

Creates and returns a reference to an item in the container.

SaveItemToFile Method

Creates a file from an object in the Storage container.

SetItem Method

Sets the contents of the specified item.

SetItemAsync Method

SetItemAsync

SetItemFromFile Method

Copies a file to the specified Storage item..

SetItemFromFileAsync Method

SetItemFromFileAsync

ShowConnectionStringDialog Method

Displays the Storage Connection String dialog. Returns a connection string in either clear text or encrypted if the connection string was encrypted in the dialog.

Verify Method

Verify

WaitForAllSetItemCallsToFinish Method

WaitForAllSetItemCallsToFinish

WriteItemToStream Method

Retrieves an item from the Storage container using the name provided and writes it to the provided stream variable.

See Also