Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/AWS4D.Interfaces.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface

uses
System.Classes,
Jpeg,
Vcl.Imaging.Jpeg,
{$IFDEF HAS_FMX}
FMX.Objects;
{$ELSE}
Expand Down Expand Up @@ -42,9 +42,11 @@ interface
function AccountName( aValue : String ) : iAWS4DCredential; overload;
function StorageEndPoint( aValue : String ) : iAWS4DCredential; overload;
function Bucket ( aValue : String ) : iAWS4DCredential; overload;
function BucketRegion ( aValue : String) : iAWS4DCredential; overload;
function AccountKey : String; overload;
function AccountName : String; overload;
function StorageEndPoint : String; overload;
function BucketRegion : String; overload;
function Bucket : String; overload;
function &End : iAWS4D;
end;
Expand Down
14 changes: 14 additions & 0 deletions src/AWS4D.S3.Credencial.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ TAWS4DCredential = class(TInterfacedObject, iAWS4DCredential)
FAccountName : String;
FStorageEndPoint : String;
FBucket : String;
FBucketRegion : String;
public
constructor Create (aParent : iAWS4D);
destructor Destroy; override;
Expand All @@ -23,10 +24,12 @@ TAWS4DCredential = class(TInterfacedObject, iAWS4DCredential)
function AccountName( aValue : String ) : iAWS4DCredential; overload;
function StorageEndPoint( aValue : String ) : iAWS4DCredential; overload;
function Bucket ( aValue : String ) : iAWS4DCredential; overload;
function BucketRegion ( aValue : String) : iAWS4DCredential; overload;
function AccountKey : String; overload;
function AccountName : String; overload;
function StorageEndPoint : String; overload;
function Bucket : String; overload;
function BucketRegion : String; overload;
function &End : iAWS4D;
end;

Expand Down Expand Up @@ -101,4 +104,15 @@ function TAWS4DCredential.Bucket: String;
Result := FBucket;
end;

function TAWS4DCredential.BucketRegion: String;
begin
Result := FBucketRegion;
end;

function TAWS4DCredential.BucketRegion(aValue: String): iAWS4DCredential;
begin
Result := Self;
FBucketRegion := aValue;
end;

end.
2 changes: 1 addition & 1 deletion src/AWS4D.S3.Get.pas
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ implementation
Data.Cloud.AmazonAPI,
Data.Cloud.CloudAPI,
System.SysUtils,
Jpeg;
Vcl.Imaging.Jpeg;

{ TBind4DAmazonS3Get }

Expand Down
3 changes: 2 additions & 1 deletion src/AWS4D.S3.Send.pas
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ function TAWS4DS3SendFile.Send: iAWS4DS3;
nil,
Header,
amzbaPublicReadWrite,
CloudResponse
CloudResponse,
FParent.&End.Credential.BucketRegion
) then
FParent.Content('https://' + FParent.&End.Credential.Bucket + '.' + FParent.&End.Credential.StorageEndPoint + '/' + FFileName);
finally
Expand Down
2 changes: 1 addition & 1 deletion src/AWS4D.S3.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ interface
uses
System.Classes,
AWS4D.Interfaces,
Jpeg,
Vcl.Imaging.Jpeg,
{$IFDEF HAS_FMX}
FMX.Objects;
{$ELSE}
Expand Down