private void parseException(string uri) { string bucket; string region; string itemLocalPath; IDictionary <string, string> queryParams; S3V4URLHelpers.Parse(uri, out bucket, out region, out itemLocalPath, out queryParams); }
public S3V4URI(string path) { m_Path = path;//.TrimEnd('/'); m_Uri = new Uri(path); S3V4URLHelpers.Parse(m_Uri, out m_Bucket, out m_Region, out m_LocalPath, out m_QueryParams); m_LocalName = m_Uri.GetLocalName(); m_ParentPath = m_Uri.GetParentURL(); }
public void ParseFolderFile() { string bucket; string region; string itemLocalPath; S3V4URLHelpers.Parse("https://it-adapter.s3-ap-southeast-1.amazonaws.com/MyFolder/MyFile1.txt", out bucket, out region, out itemLocalPath); Assert.AreEqual("it-adapter", bucket); Assert.AreEqual("ap-southeast-1", region); Assert.AreEqual("MyFolder/MyFile1.txt", itemLocalPath); }
public void ParseFolderRoot() { string bucket; string region; string itemLocalPath; S3V4URLHelpers.Parse("https://dxw.s3-us-west-2.amazonaws.com/MyFolder/", out bucket, out region, out itemLocalPath); Assert.AreEqual("dxw", bucket); Assert.AreEqual("us-west-2", region); Assert.AreEqual("MyFolder/", itemLocalPath); }
public void ParseDefaultRegion() { string bucket; string region; string itemLocalPath; S3V4URLHelpers.Parse("https://dxw.s3.amazonaws.com/", out bucket, out region, out itemLocalPath); Assert.AreEqual("dxw", bucket); Assert.AreEqual(S3V4URLHelpers.US_EAST_1, region); Assert.AreEqual(string.Empty, itemLocalPath); }
public void ParseRoot() { string bucket; string region; string itemLocalPath; S3V4URLHelpers.Parse("https://dxw.s3-us-west-2.amazonaws.com/", out bucket, out region, out itemLocalPath); Aver.AreEqual("dxw", bucket); Aver.AreEqual("us-west-2", region); Aver.AreEqual(string.Empty, itemLocalPath); }
public void ParseFolderFileParameters() { string bucket; string region; string itemLocalPath; IDictionary <string, string> queryParams; S3V4URLHelpers.Parse("https://dxw.s3-us-west-2.amazonaws.com/MyFolder/MyFile1.txt?marker=1&max-keys=100", out bucket, out region, out itemLocalPath, out queryParams); Assert.AreEqual("dxw", bucket); Assert.AreEqual("us-west-2", region); Assert.AreEqual("MyFolder/MyFile1.txt", itemLocalPath); Assert.IsNotNull(queryParams); Assert.AreEqual(2, queryParams.Count); Assert.IsTrue(queryParams.ContainsKey("marker")); Assert.IsTrue(queryParams.ContainsKey("max-keys")); Assert.AreEqual("1", queryParams["marker"]); Assert.AreEqual("100", queryParams["max-keys"]); }