C# Class azurecopy.S3Handler

Inheritance: IBlobHandler
显示文件 Open project: kpfaulkner/azurecopy Class Usage Examples

Public Properties

Property Type Description
AwsKeyIdentifier string
AwsRegionIdentifier string
AwsSecretKeyIdentifier string

Private Properties

Property Type Description
GenerateUrl string
GetBlobPrefixFromUrl string
GetDefaultKey string

Public Methods

Method Description
GetBaseUrl ( ) : string
GetBlobNameFromUrl ( string url ) : string

Gets blob name from the full url.

GetContainerNameFromUrl ( string url ) : string
ListBlobsInContainer ( string containerName = null, string blobPrefix = null, bool debug = false ) : IEnumerable

Lists all blobs in a container. Can be supplied a blobPrefix which basically acts as virtual directory options. eg, if we have blobs called: "virt1/virt2/myblob" and "virt1/virt2/myblob2" Although the blob names are the complete strings mentioned above, we might like to think that the blobs are just called myblob and myblob2. We can supply a blobPrefix of "virt1/virt2/" which we can *think* of as a directory, but again, its just really a prefix behind the scenes.

ListContainers ( string root ) : List

List containers/directories off the root. For storage schemes that allow real directories maybe the root will be

MakeContainer ( string containerName ) : void

Make container/directory (depending on platform). assumption being last part of url is the new container. With S3 "containers" could really be the bucket for the account IMPORTANT NOTE: For S3 the bucket comes from the url. The container name is just the fake virtual directory. ie blob of 0 bytes.

MoveBlob ( string originContainer, string destinationContainer, string startBlobname ) : void

Move blob

OverrideConfiguration ( string>.Dictionary configuration ) : void
ReadBlob ( string containerName, string blobName, string cacheFilePath = "" ) : Blob

Read blob.

S3Handler ( string url ) : System
S3Handler ( string url, string awsKey, string awsKeySecret ) : System
WriteBlob ( string containerName, string blobName, Blob blob, int parallelUploadFactor = 1, int chunkSizeInMB = 4 ) : void

Write blob

Private Methods

Method Description
GenerateUrl ( string baseUrl, string bucket, string key ) : string
GetBlobPrefixFromUrl ( string url ) : string
GetDefaultKey ( string url ) : string

Method Details

GetBaseUrl() public method

public GetBaseUrl ( ) : string
return string

GetBlobNameFromUrl() public method

Gets blob name from the full url.
public GetBlobNameFromUrl ( string url ) : string
url string
return string

GetContainerNameFromUrl() public method

public GetContainerNameFromUrl ( string url ) : string
url string
return string

ListBlobsInContainer() public method

Lists all blobs in a container. Can be supplied a blobPrefix which basically acts as virtual directory options. eg, if we have blobs called: "virt1/virt2/myblob" and "virt1/virt2/myblob2" Although the blob names are the complete strings mentioned above, we might like to think that the blobs are just called myblob and myblob2. We can supply a blobPrefix of "virt1/virt2/" which we can *think* of as a directory, but again, its just really a prefix behind the scenes.
public ListBlobsInContainer ( string containerName = null, string blobPrefix = null, bool debug = false ) : IEnumerable
containerName string
blobPrefix string
debug bool
return IEnumerable

ListContainers() public method

List containers/directories off the root. For storage schemes that allow real directories maybe the root will be
public ListContainers ( string root ) : List
root string
return List

MakeContainer() public method

Make container/directory (depending on platform). assumption being last part of url is the new container. With S3 "containers" could really be the bucket for the account IMPORTANT NOTE: For S3 the bucket comes from the url. The container name is just the fake virtual directory. ie blob of 0 bytes.
public MakeContainer ( string containerName ) : void
containerName string
return void

MoveBlob() public method

Move blob
public MoveBlob ( string originContainer, string destinationContainer, string startBlobname ) : void
originContainer string
destinationContainer string
startBlobname string
return void

OverrideConfiguration() public method

public OverrideConfiguration ( string>.Dictionary configuration ) : void
configuration string>.Dictionary
return void

ReadBlob() public method

Read blob.
public ReadBlob ( string containerName, string blobName, string cacheFilePath = "" ) : Blob
containerName string
blobName string
cacheFilePath string
return Blob

S3Handler() public method

public S3Handler ( string url ) : System
url string
return System

S3Handler() public method

public S3Handler ( string url, string awsKey, string awsKeySecret ) : System
url string
awsKey string
awsKeySecret string
return System

WriteBlob() public method

Write blob
public WriteBlob ( string containerName, string blobName, Blob blob, int parallelUploadFactor = 1, int chunkSizeInMB = 4 ) : void
containerName string
blobName string
blob Blob
parallelUploadFactor int
chunkSizeInMB int
return void

Property Details

AwsKeyIdentifier public_oe static_oe property

public static string AwsKeyIdentifier
return string

AwsRegionIdentifier public_oe static_oe property

public static string AwsRegionIdentifier
return string

AwsSecretKeyIdentifier public_oe static_oe property

public static string AwsSecretKeyIdentifier
return string