Achilles.Acme.Storage.Azure.AzureCloudStorageProvider.MoveFile C# (CSharp) Method

MoveFile() public method

public MoveFile ( string sourceFileName, string destFileName ) : void
sourceFileName string
destFileName string
return void
        public override void MoveFile( string sourceFileName, string destFileName )
        {
            CloudBlockBlob sourceBlob = _container.GetBlockBlobReference( destFileName.ToAzurePath() );
            CloudBlockBlob destBlob = _container.GetBlockBlobReference( sourceFileName.ToAzurePath() );

            // TJT: Fixme..

            // Check if the original path exists on the provider.
            //if ( !IsValidFile( originalPath ) )
            //{
            //    throw new FileNotFoundException( "The path supplied does not exist on the storage provider.", originalPath );
            //}

            destBlob.StartCopyFromBlob( sourceBlob );

            try
            {
                // Make sure the destination file now exists
                destBlob.FetchAttributes();

                sourceBlob.Delete();
            }
            catch ( StorageException )
            {
                throw;
            }
        }