public static Uri AppendBlobNameToContainerUrl(Uri containerUrl, string blobName) { StringBuilder stringBuilder = new StringBuilder(containerUrl.AbsoluteUri); stringBuilder.Append("/"); stringBuilder.Append(HttpUtilities.PathEncode(blobName)); return(new Uri(stringBuilder.ToString())); }
public static string TrimRootContainerNameFromEnd(string inputString, bool isRootContainerNameEncoded) { string str = "/$root"; if (isRootContainerNameEncoded) { str = HttpUtilities.PathEncode(str); } if (!inputString.EndsWith(str)) { return(inputString); } return(inputString.Remove(inputString.Length - str.Length, str.Length)); }
public static string ConstructCopySourceResource(string accountName, string containerName, string blobName) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("/"); stringBuilder.Append(accountName); if (!string.IsNullOrEmpty(containerName)) { stringBuilder.Append("/"); stringBuilder.Append(containerName); } if (!string.IsNullOrEmpty(blobName)) { stringBuilder.Append("/"); stringBuilder.Append(blobName); } return(HttpUtilities.PathEncode(stringBuilder.ToString())); }
public static string ConstructCopySourceResource(string accountName, string containerName, string blobName, DateTime?snapshot) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("/"); stringBuilder.Append(accountName); if (!string.IsNullOrEmpty(containerName)) { stringBuilder.Append("/"); stringBuilder.Append(containerName); } if (!string.IsNullOrEmpty(blobName)) { stringBuilder.Append("/"); stringBuilder.Append(blobName); } string str = (snapshot.HasValue ? HttpUtilities.GetSnapshotQueryParameterStringForUrl(snapshot.Value) : string.Empty); return(string.Concat(HttpUtilities.PathEncode(stringBuilder.ToString()), str)); }
private static Uri ConstructUriFromUriAndString(Uri endpoint, string path) { return(new Uri(endpoint, HttpUtilities.PathEncode(path))); }
public static string GetSnapshotQueryParameterStringForUrl(DateTime snapshot) { return(string.Format("?{0}={1}", "snapshot", HttpUtilities.PathEncode(HttpUtilities.ConvertSnapshotDateTimeToHttpString(snapshot)))); }