Skip to main content
Version: 2.1

IS3Object

Interface in AWS.S3

Interface for S3 Objects.

Properties​

AcceptRanges​

property AcceptRanges: string

Indicates that a range of bytes was specified.

ArchiveStatus​

property ArchiveStatus: string

The archive state of the object.

Valid values: ARCHIVE_ACCESS | DEEP_ARCHIVE_ACCESS.

Bucket​

property Bucket: IS3Bucket

Type: IS3Bucket

The object's bucket.

CacheControl​

property CacheControl: string

Specifies caching behaviour.

ContentDisposition​

property ContentDisposition: string

Specifies presentational information for the object.

ContentEncoding​

property ContentEncoding: string

Specifies what content encodings have been applied to the object.

ContentLanguage​

property ContentLanguage: string

The language the content is in.

ContentLength​

property ContentLength: Int64

Size of the body in bytes.

ContentType​

property ContentType: string

The MIME type for the content.

Client​

property Client: IS3Client

Type: IS3Client

The S3 Client used to perform actions on this object.

DeleteMarker​

property DeleteMarker: Boolean

Specifies whether the object returned was a delete marker.

ETag​

property ETag: string

The entity tag represents a specific verion of the object.

Expiration​

property Expiration: string

The expiration date and rule ID if the object is configured to expire.

Expires​

property Expires: TOptional<TDateTime>

The date and time at which the object is no longer cacheable.

Key​

property Key: string

The object's key.

LastModified​

property LastModified: TOptional<TDateTime>

The creation date and time of the object.

Metadata​

property Metadata: TDictionary<string, string>

Object metadata.

MissingMeta​

property MissingMeta: TOptional<Integer>

The number of missing metadata entries not returned.

ObjectLockLegalHoldStatus​

property ObjectLockLegalHoldStatus: string

Indicates whether this object has an active Legal Hold.

Valid values: ON | OFF.

ObjectLockMode​

property ObjectLockMode: string

The Object Lock mode currently in place for this object.

Valid values: ON | OFF.

ObjectLockRetainUntilDate​

property ObjectLockRetainUntilDate: TOptional<TDateTime>

The date and time the Object Lock will expire.

Owner​

property Owner: IS3Owner

Type: IS3Owner

The object owner's details.

PartsCount​

property PartsCount: TOptional<Integer>

The count of parts this object has.

ReplicationStatus​

property ReplicationStatus: string

Indicates if the request involves a bucket that is either a source or destination in a replication rule.

Valid values: COMPLETE | PENDING | FAILED | REPLICA.

RequestCharged​

property RequestCharged: string

Indicates the requester was successfully charged for the request.

Valid values: requester.

Restore​

property Restore: string

Provides information about object restoration action and expiration time of the restored object copy.

ServerSideEncryption​

property ServerSideEncryption: string

The server-side encryption algorithm used when storing this object in Amazon S3.

Size​

property Size: TOptional<Int64>

The object's size in bytes.

SseBucketKeyEnabled​

property SseBucketKeyEnabled: TOptional<Boolean>

Indicates whether the object uses an S3 Bucket Key for the server-side encryption with AWS KMS (SSE-KMS).

SseCustomerAlgorithm​

property SseCustomerAlgorithm: string

If server-side encryption with a customer-provided encryption key was requested, this will confirm the algorithm to used for encryption.

SseCustomerKeyMD5​

property SseCustomerKeyMD5: string

If server-side encryption with a customer-provided encryption key was requested, this will be provided for round-trip message integrity verification of the customer-provided encryption key.

SseKmsKeyId​

property SseKmsKeyId: string

The ID of the AWS Key Management Service (KMS) symemetric customer managed key that was used for the object.

StorageClass​

property StorageClass: string

Provides storage class information of the object.

Valid values are: STANDARD | REDUCED_REDUNDANCY | STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING | GLACIER | DEEP_ARCHIVE | OUTPOSTS.

VersionId​

property VersionId: string

The version of the object.

WebsiteRedirectLocation​

property WebsiteRedirectLocation: string

If the bucket is configured as a website, this specifies if and where the object is redirected to.

Methods​

CopyTo​

function CopyTo(const ADestinationKey: string): IS3CopyObjectResponse;

IS3CopyObjectResponse

Copy the object to a specified destination key within the same bucket.

Parameters

NameDescription
ADestinationKeySpecify the destination key to copy the object to.

Returns

A CopyObject response.

Delete​

function Delete: IS3DeleteObjectResponse;

IS3DeleteObjectResponse

Deletes the object.

Returns

A DeleteObject response.

DownloadFile​

function DownloadFile(const ADestination: string): Boolean;

Download the object to a file.

Parameters

NameDescription
ADestinationSpecifies the destination file name.

Returns

A Boolean value indicating success () or failure ().

Exists​

function Exists: Boolean;

Checks if an object exists.

Returns

A Boolean value indicating if the specified object exists on S3.

Get​

function Get: IS3GetObjectResponse;

IS3GetObjectResponse

Fetches an object.

Returns

A GetObject response.

function Head: IS3HeadObjectResponse;

IS3HeadObjectResponse

Retrieve the object's metadata.

Returns

A HeadObject response.

Put​

function Put(const ABody: TStream; ASendDataCallback: TAWSClientSendDataCallback = nil): IS3PutObjectResponse; overload;

IS3PutObjectResponse

Uploads an object's content.

Parameters

NameDescription
ABodyA stream containing the object's binary content to upload.
ASendDataCallbackA callback providing progress updates for the upload.

Returns

A PutObject response.


function Put(const AAttributes: IS3ObjectPutAttributes; ASendDataCallback: TAWSClientSendDataCallback = nil): IS3PutObjectResponse; overload;

IS3ObjectPutAttributes → IS3PutObjectResponse

Uploads an object's content with attributes.

Parameters

NameDescription
AAttributesA stream containing the object's binary content to upload.
ASendDataCallbackA callback providing progress updates for the upload.

Returns

A PutObject response.

Rename​

function Rename(const ANewKey: string): Boolean;

Rename the object.

Parameters

NameDescription
ANewKeySpecify a new key for the object.

Returns

Returnson success, otherwise.

UploadFile​

function UploadFile(const AFilePath: string; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil; AFileUploader: IS3FileUploader = nil): Boolean;

IS3FileUploader

Uploads a file to the object.

var LObject := TS3Object.Create('my-bucket', 'my-object') as IS3Object; LObject.UploadFile( '/path/to/file', False, procedure(const AUploadId: string; APartNumber: Integer; APartSize, APartWriteCount, AOverallSize, AOverallWriteCount: Int64; var AAbort: Boolean) begin // Update your user interface with current progress. end ); )

Parameters

NameDescription
AFilePathThe path of a file to upload.
AUseTempFilesOptional Boolean value indicating whether to use temp-files () or memory () for buffering parts. The use of temporary files reduces memory pressure when uploading large files.
AOnProgressAn optional callback providing progress updates.
AFileUploaderAn optional IS3FileUploader instance to handle the file upload.

Returns

A Boolean value indicating success () or failure ().

UploadStream​

function UploadStream(const AStream: TStream; AUseTempFiles: Boolean = False; AOnProgress: TS3UploadPartBatchProgressCallback = nil; AStreamUploader: IS3StreamUploader = nil): Boolean;

IS3StreamUploader

Uploads the contents of a stream to the object.

// Create or load a stream of data to upload. var LStream := TMemoryStream.Create; var LObject := TS3Object.Create('my-bucket', 'my-object') as IS3Object; LObject.UploadStream( LStream, False, procedure(const AUploadId: string; APartNumber: Integer; APartSize, APartWriteCount, AOverallSize, AOverallWriteCount: Int64; var AAbort: Boolean) begin // Update your user interface with current progress. end ); )

Parameters

NameDescription
AStreamA TStream instance containing data for the object.
AUseTempFilesOptional Boolean value indicating whether to use temp-files () or memory () for buffering parts. The use of temporary files reduces memory pressure when uploading large files.
AOnProgressAn optional callback providing progress updates.
AFileUploaderAn optional IS3FileUploader instance to handle the file upload.

Returns

A Boolean value indicating success () or failure ().