-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from EmmaZhu/dev
Upgrade to Azure Storage Client Library 9.4.2 and fix bugs
- Loading branch information
Showing
46 changed files
with
677 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
//------------------------------------------------------------------------------ | ||
// <copyright file="StorageCopyState.cs" company="Microsoft"> | ||
// Copyright (c) Microsoft Corporation | ||
// </copyright> | ||
//------------------------------------------------------------------------------ | ||
|
||
namespace Microsoft.WindowsAzure.Storage.DataMovement.Extensions | ||
{ | ||
using System; | ||
|
||
internal enum StorageCopyStatus | ||
{ | ||
// | ||
// Summary: | ||
// The copy status is invalid. | ||
Invalid = 0, | ||
// | ||
// Summary: | ||
// The copy operation is pending. | ||
Pending = 1, | ||
// | ||
// Summary: | ||
// The copy operation succeeded. | ||
Success = 2, | ||
// | ||
// Summary: | ||
// The copy operation has been aborted. | ||
Aborted = 3, | ||
// | ||
// Summary: | ||
// The copy operation encountered an error. | ||
Failed = 4 | ||
} | ||
|
||
internal class StorageCopyState | ||
{ | ||
public StorageCopyState(Microsoft.WindowsAzure.Storage.Blob.CopyState blobCopyState) | ||
{ | ||
this.CopyId = blobCopyState.CopyId; | ||
this.SetStatus(blobCopyState.Status); | ||
this.Source = blobCopyState.Source; | ||
this.BytesCopied = blobCopyState.BytesCopied; | ||
this.TotalBytes = blobCopyState.TotalBytes; | ||
this.StatusDescription = blobCopyState.StatusDescription; | ||
} | ||
|
||
public StorageCopyState(Microsoft.WindowsAzure.Storage.File.CopyState fileCopyState) | ||
{ | ||
this.CopyId = fileCopyState.CopyId; | ||
this.SetStatus(fileCopyState.Status); | ||
this.Source = fileCopyState.Source; | ||
this.BytesCopied = fileCopyState.BytesCopied; | ||
this.TotalBytes = fileCopyState.TotalBytes; | ||
this.StatusDescription = fileCopyState.StatusDescription; | ||
} | ||
|
||
private void SetStatus(Microsoft.WindowsAzure.Storage.Blob.CopyStatus blobCopyStatus) | ||
{ | ||
switch (blobCopyStatus) | ||
{ | ||
case Blob.CopyStatus.Invalid: | ||
this.Status = StorageCopyStatus.Invalid; | ||
break; | ||
case Blob.CopyStatus.Pending: | ||
this.Status = StorageCopyStatus.Pending; | ||
break; | ||
case Blob.CopyStatus.Success: | ||
this.Status = StorageCopyStatus.Success; | ||
break; | ||
case Blob.CopyStatus.Aborted: | ||
this.Status = StorageCopyStatus.Aborted; | ||
break; | ||
case Blob.CopyStatus.Failed: | ||
this.Status = StorageCopyStatus.Failed; | ||
break; | ||
default: | ||
this.Status = StorageCopyStatus.Invalid; | ||
break; | ||
} | ||
} | ||
|
||
private void SetStatus(Microsoft.WindowsAzure.Storage.File.CopyStatus fileCopyStatus) | ||
{ | ||
switch (fileCopyStatus) | ||
{ | ||
case File.CopyStatus.Invalid: | ||
this.Status = StorageCopyStatus.Invalid; | ||
break; | ||
case File.CopyStatus.Pending: | ||
this.Status = StorageCopyStatus.Pending; | ||
break; | ||
case File.CopyStatus.Success: | ||
this.Status = StorageCopyStatus.Success; | ||
break; | ||
case File.CopyStatus.Aborted: | ||
this.Status = StorageCopyStatus.Aborted; | ||
break; | ||
case File.CopyStatus.Failed: | ||
this.Status = StorageCopyStatus.Failed; | ||
break; | ||
default: | ||
this.Status = StorageCopyStatus.Invalid; | ||
break; | ||
} | ||
} | ||
|
||
// | ||
// Summary: | ||
// Gets the ID of the copy operation. | ||
public string CopyId { get; private set; } | ||
// | ||
// Summary: | ||
// Gets the status of the copy operation. | ||
public StorageCopyStatus Status { get; private set; } | ||
// | ||
// Summary: | ||
// Gets the source URI of a copy operation. | ||
public Uri Source { get; private set; } | ||
// | ||
// Summary: | ||
// Gets the number of bytes copied in the operation so far. | ||
public long? BytesCopied { get; private set; } | ||
// | ||
// Summary: | ||
// Gets the total number of bytes in the source of the copy. | ||
public long? TotalBytes { get; private set; } | ||
// | ||
// Summary: | ||
// Gets the description of the current status, if any. | ||
public string StatusDescription { get; private set; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.