本文整理匯總了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);
}