本文整理匯總了C#中net.openstack.Providers.Rackspace.CloudFilesProvider.DisableStaticWebOnContainer方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudFilesProvider.DisableStaticWebOnContainer方法的具體用法?C# CloudFilesProvider.DisableStaticWebOnContainer怎麽用?C# CloudFilesProvider.DisableStaticWebOnContainer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.openstack.Providers.Rackspace.CloudFilesProvider
的用法示例。
在下文中一共展示了CloudFilesProvider.DisableStaticWebOnContainer方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Should_Disable_Static_Web_On_Container
public void Should_Disable_Static_Web_On_Container()
{
var provider = new CloudFilesProvider();
//var cdnEnabledResponse = provider.EnableCDNOnContainer( containerName, true, identity: _testIdentity);
provider.DisableStaticWebOnContainer(containerName, null, false, _testIdentity);
var cdnContainerMetaDataResponse = provider.GetContainerMetaData(containerName, identity: _testIdentity);
Assert.IsFalse(cdnContainerMetaDataResponse.ContainsKey("Web-Index"));
Assert.IsFalse(cdnContainerMetaDataResponse.ContainsKey("Web-Error"));
Assert.IsFalse(cdnContainerMetaDataResponse.ContainsKey("Web-Listings-Css"));
Assert.IsFalse(cdnContainerMetaDataResponse.ContainsKey("Web-Listings"));
}
示例2: 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);
}