BlobRequest.CopyFrom Method

Storage Client Library NET API

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Constructs a web request to copy a blob.

Namespace: Microsoft.WindowsAzure.StorageClient.Protocol
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

Usage

Visual Basic
Dim uri As Uri
Dim timeout As Integer
Dim source As String
Dim sourceSnapshot As Nullable(Of DateTime)
Dim sourceConditions As ConditionHeaderKind
Dim sourceConditionsValue As String
Dim leaseId As String
Dim returnValue As HttpWebRequest

returnValue = BlobRequest.CopyFrom(uri, timeout, source, sourceSnapshot, sourceConditions, sourceConditionsValue, leaseId)

Syntax

Visual Basic
Public Shared Function CopyFrom ( _
	uri As Uri, _
	timeout As Integer, _
	source As String, _
	sourceSnapshot As Nullable(Of DateTime), _
	sourceConditions As ConditionHeaderKind, _
	sourceConditionsValue As String, _
	leaseId As String _
) As HttpWebRequest
C#
public static HttpWebRequest CopyFrom (
	Uri uri,
	int timeout,
	string source,
	Nullable<DateTime> sourceSnapshot,
	ConditionHeaderKind sourceConditions,
	string sourceConditionsValue,
	string leaseId
)
C++
public:
static HttpWebRequest^ CopyFrom (
	Uri^ uri, 
	int timeout, 
	String^ source, 
	Nullable<DateTime> sourceSnapshot, 
	ConditionHeaderKind sourceConditions, 
	String^ sourceConditionsValue, 
	String^ leaseId
)
J#
JScript

Parameters

uri

Type: System.Uri

The absolute URI to the destination blob.

timeout

Type: System.Int32

The server timeout interval.

source

Type: System.String

The canonical path to the source blob, in the form /<account-name>/<container-name>/<blob-name>.

sourceSnapshot

Type: System.Nullable

The snapshot version, if the source blob is a snapshot.

sourceConditions

Type: Microsoft.WindowsAzure.StorageClient.Protocol.ConditionHeaderKind

A type of condition to check on the source blob.

sourceConditionsValue

Type: System.String

The value of the condition to check on the source blob.

leaseId

Type: System.String

The lease ID for the source blob, if it has an active lease.

Return Value

Type: System.Net.HttpWebRequest

A web request to use to perform the operation.

Remarks

If the destination blob has an active lease, you must specify a valid lease ID for the active lease in order to copy the blob.

If the source blob has an active lease, you can optionally specify the lease ID for the source blob to copy the source blob conditionally. In this case, the source blob will be copied only if the lease ID for the source blob matches that specified on the request.

Copying a blob does not affect an existing lease on the destination blob. The destination blob's lease is maintained, whether you are copying a blob to a destination blob with a different name from the source, copying the blob to a destination blob with the same name as the source, or copying a snapshot over its base blob.

For more details about this API, see the topics on the equivalent REST APIs in See Also > Other Resources.


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

See Also