C# Class azurecopy.Utils.S3Helper

ASSUMPTION is that all S3 URLs will be in format https://bucketname.s3.amazonaws.com and NOT https://s3.amazonaws.com/bucketname Will need to handle both eventually.
Show file Open project: kpfaulkner/azurecopy

Public Methods

Method Description
FormatUrl ( string url ) : string

Format URL into s3.amazonaws.com/bucketname regardless of format it comes in with. Not foolproof, but should handle the common cases. FIXME: Will need to revisit.

GeneratePreSignedUrl ( string bucket, string key, int timeout = 30 ) : string
GenerateS3Client ( string accessKey, string secretKey, string bucketName = null ) : IAmazonS3
GetBucketFromUrl ( string url ) : string
GetDisplayName ( string fullBlobName ) : string
GetKeyFromUrl ( string url ) : string
MatchHandler ( string url ) : bool

Private Methods

Method Description
GenerateRegionDict ( ) : Amazon.RegionEndpoint>.Dictionary
GetPrefixFromUrl ( string baseUrl ) : string
S3Helper ( ) : System

Method Details

FormatUrl() public static method

Format URL into s3.amazonaws.com/bucketname regardless of format it comes in with. Not foolproof, but should handle the common cases. FIXME: Will need to revisit.
public static FormatUrl ( string url ) : string
url string
return string

GeneratePreSignedUrl() public static method

public static GeneratePreSignedUrl ( string bucket, string key, int timeout = 30 ) : string
bucket string
key string
timeout int
return string

GenerateS3Client() public static method

public static GenerateS3Client ( string accessKey, string secretKey, string bucketName = null ) : IAmazonS3
accessKey string
secretKey string
bucketName string
return IAmazonS3

GetBucketFromUrl() public static method

public static GetBucketFromUrl ( string url ) : string
url string
return string

GetDisplayName() public static method

public static GetDisplayName ( string fullBlobName ) : string
fullBlobName string
return string

GetKeyFromUrl() public static method

public static GetKeyFromUrl ( string url ) : string
url string
return string

MatchHandler() public static method

public static MatchHandler ( string url ) : bool
url string
return bool