示例#1
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }
示例#5
0
        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));
        }