本文整理汇总了C#中net.openstack.Providers.Rackspace.CloudFilesProvider.EnableStaticWebOnContainer方法的典型用法代码示例。如果您正苦于以下问题:C# CloudFilesProvider.EnableStaticWebOnContainer方法的具体用法?C# CloudFilesProvider.EnableStaticWebOnContainer怎么用?C# CloudFilesProvider.EnableStaticWebOnContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.openstack.Providers.Rackspace.CloudFilesProvider
的用法示例。
在下文中一共展示了CloudFilesProvider.EnableStaticWebOnContainer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Enable_Static_Web_On_Container_With_CSS_And_Listing_As_True
public void Should_Enable_Static_Web_On_Container_With_CSS_And_Listing_As_True()
{
var provider = new CloudFilesProvider();
//var cdnEnabledResponse = provider.EnableCDNOnContainer( containerName, true, identity: _testIdentity);
provider.EnableStaticWebOnContainer(containerName, webListingsCSS, webListing, null, false, _testIdentity);
var cdnContainerMetaDataResponse = provider.GetContainerMetaData(containerName, identity: _testIdentity);
Assert.AreEqual(webListingsCSS, cdnContainerMetaDataResponse.Where(x => x.Key.Equals("web-listings-css", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault().Value);
Assert.IsTrue(bool.Parse(cdnContainerMetaDataResponse.Where(x => x.Key.Equals("web-listings", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault().Value));
}
示例2: Should_Enable_Static_Web_On_Container_With_Index_And_Error
public void Should_Enable_Static_Web_On_Container_With_Index_And_Error()
{
var provider = new CloudFilesProvider();
//var cdnEnabledResponse = provider.EnableCDNOnContainer( containerName, true, identity: _testIdentity);
provider.EnableStaticWebOnContainer(containerName, webIndex, webError, null, false, _testIdentity);
var cdnContainerMetaDataResponse = provider.GetContainerMetaData(containerName, identity: _testIdentity);
Assert.AreEqual(webIndex, cdnContainerMetaDataResponse.Where(x => x.Key.Equals("Web-index", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault().Value);
Assert.AreEqual(webError, cdnContainerMetaDataResponse.Where(x => x.Key.Equals("web-error", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault().Value);
}
示例3: TestStaticWebOnContainer
public void TestStaticWebOnContainer()
{
IObjectStorageProvider provider = new CloudFilesProvider(Bootstrapper.Settings.TestIdentity);
string containerName = TestContainerPrefix + Path.GetRandomFileName();
string objectName = Path.GetRandomFileName();
string fileContents = "File contents!";
ObjectStore result = provider.CreateContainer(containerName);
Assert.AreEqual(ObjectStore.ContainerCreated, result);
Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(fileContents));
provider.CreateObject(containerName, stream, objectName);
Dictionary<string, string> cdnHeaders = provider.EnableCDNOnContainer(containerName, false);
Assert.IsNotNull(cdnHeaders);
Console.WriteLine("CDN Headers");
foreach (var pair in cdnHeaders)
Console.WriteLine(" {0}: {1}", pair.Key, pair.Value);
string index = objectName;
string error = objectName;
string css = objectName;
provider.EnableStaticWebOnContainer(containerName, index: index, error: error, listing: false);
provider.DisableStaticWebOnContainer(containerName);
provider.DeleteContainer(containerName, deleteObjects: true);
}