public CloudFileDirectory GetCloudFileDirReference(string rootPath, DirNode dirNode, StorageCredentials credentials = null) { var share = this.fileHelper.FileClient.GetShareReference(this.shareName, snapshotTime); if (credentials != null) { share = new CloudFileShare(share.SnapshotQualifiedStorageUri, credentials); } string dirName = dirNode.GetURLRelativePath(); if (dirName.StartsWith("/")) { dirName = dirName.Substring(1, dirName.Length - 1); } if (!string.IsNullOrEmpty(rootPath)) { dirName = rootPath + "/" + dirName; } if (string.IsNullOrEmpty(dirName)) { return(share.GetRootDirectoryReference()); } else { return(share.GetRootDirectoryReference().GetDirectoryReference(dirName)); } }
public CloudFileDirectory GetCloudFileDirReference(DirNode dirNode) { var share = this.fileHelper.FileClient.GetShareReference(this.shareName); string dirName = dirNode.GetURLRelativePath(); if (dirName.StartsWith("/")) { dirName = dirName.Substring(1, dirName.Length - 1); } return(share.GetRootDirectoryReference().GetDirectoryReference(dirName)); }
public CloudBlobDirectory GetCloudBlobDirReference(DirNode dirNode) { var container = this.BlobHelper.BlobClient.GetContainerReference(this.ContainerName); var dirName = dirNode.GetURLRelativePath(); if (dirName.StartsWith("/")) { dirName = dirName.Substring(1, dirName.Length - 1); } return(container.GetDirectoryReference(dirName)); }
public CloudBlobDirectory GetCloudBlobDirReference(string rootPath, DirNode dirNode, StorageCredentials credentials = null) { var container = this.BlobHelper.BlobClient.GetContainerReference(this.ContainerName); if (credentials != null) { container = new CloudBlobContainer(container.StorageUri, credentials); } var dirName = dirNode.GetURLRelativePath(); if (dirName.StartsWith("/")) { dirName = dirName.Substring(1, dirName.Length - 1); } if (!string.IsNullOrEmpty(rootPath)) { dirName = rootPath + "/" + dirName; } return(container.GetDirectoryReference(dirName)); }
public CloudFileDirectory GetCloudFileDirReference(string rootPath, DirNode dirNode) { var share = this.fileHelper.FileClient.GetShareReference(this.shareName); string dirName = dirNode.GetURLRelativePath(); if (dirName.StartsWith("/")) { dirName = dirName.Substring(1, dirName.Length - 1); } if (!string.IsNullOrEmpty(rootPath)) { dirName = rootPath + "/" + dirName; } if (string.IsNullOrEmpty(dirName)) { return(share.GetRootDirectoryReference()); } else { return(share.GetRootDirectoryReference().GetDirectoryReference(dirName)); } }