public static string DetailedInfo(this FileNode fileNode) { StringBuilder builder = new StringBuilder(); builder.AppendFormat("FileNode {0}: MD5 ({1}), LMT ({2})", fileNode.GetURLRelativePath(), fileNode.MD5, fileNode.LastModifiedTime); return(builder.ToString()); }
public CloudBlob GetCloudBlobReference(FileNode fileNode) { var container = this.BlobHelper.BlobClient.GetContainerReference(this.ContainerName); var blobName = fileNode.GetURLRelativePath(); if (blobName.StartsWith("/")) { blobName = blobName.Substring(1, blobName.Length - 1); } return(CloudBlobHelper.GetCloudBlobReference(container, blobName, this.BlobType)); }
public CloudFile GetCloudFileReference(FileNode fileNode) { var share = this.fileHelper.FileClient.GetShareReference(this.shareName); string fileName = fileNode.GetURLRelativePath(); if (fileName.StartsWith("/")) { fileName = fileName.Substring(1, fileName.Length - 1); } return(share.GetRootDirectoryReference().GetFileReference(fileName)); }
public CloudFile GetCloudFileReference(string rootPath, FileNode fileNode, StorageCredentials credentials = null) { var share = this.fileHelper.FileClient.GetShareReference(this.shareName, snapshotTime); if (credentials != null) { share = new CloudFileShare(share.SnapshotQualifiedStorageUri, credentials); } string fileName = fileNode.GetURLRelativePath(); if (fileName.StartsWith("/")) { fileName = fileName.Substring(1, fileName.Length - 1); } if (!string.IsNullOrEmpty(rootPath)) { fileName = rootPath + "/" + fileName; } return(share.GetRootDirectoryReference().GetFileReference(fileName)); }
public CloudBlob GetCloudBlobReference(string rootPath, FileNode fileNode, StorageCredentials credentials = null) { var container = this.BlobHelper.BlobClient.GetContainerReference(this.ContainerName); if (credentials != null) { container = new CloudBlobContainer(container.StorageUri, credentials); } var blobName = fileNode.GetURLRelativePath(); if (blobName.StartsWith("/")) { blobName = blobName.Substring(1, blobName.Length - 1); } if (!string.IsNullOrEmpty(rootPath)) { blobName = rootPath + "/" + blobName; } return(CloudBlobHelper.GetCloudBlobReference(container, blobName, this.BlobType)); }