Examples of CreateContainerOptions


Examples of org.jclouds.openstack.swift.options.CreateContainerOptions

      assertEquals(ImmutableList.of(".r:*,.rlistings"),
               options.buildRequestHeaders().get("X-Container-Read"));
   }

   public void testPublicAccessStatic() {
      CreateContainerOptions options = CreateContainerOptions.Builder.withPublicAccess();
      assertEquals(ImmutableList.of(".r:*,.rlistings"),
               options.buildRequestHeaders().get("X-Container-Read"));
   }

Examples of org.jclouds.openstack.swift.options.CreateContainerOptions

      assertEquals(ImmutableList.of(".r:*,.rlistings"),
               options.buildRequestHeaders().get("X-Container-Read"));
   }

   public void testMetadata() {
      CreateContainerOptions options = new CreateContainerOptions().withMetadata(ImmutableMap
               .of("test", "foo"));
      assertEquals(ImmutableList.of("foo"), options.buildRequestHeaders().get(
               SwiftHeaders.CONTAINER_METADATA_PREFIX + "test"));
   }

Examples of org.jclouds.openstack.swift.options.CreateContainerOptions

      assertEquals(ImmutableList.of("foo"), options.buildRequestHeaders().get(
               SwiftHeaders.CONTAINER_METADATA_PREFIX + "test"));
   }

   public void testMetadataAlreadyPrefixed() {
      CreateContainerOptions options = new CreateContainerOptions().withMetadata(ImmutableMap
               .of(SwiftHeaders.CONTAINER_METADATA_PREFIX + "test", "foo"));
      assertEquals(ImmutableList.of("foo"), options.buildRequestHeaders().get(
          SwiftHeaders.CONTAINER_METADATA_PREFIX + "test"));
   }

Examples of org.jclouds.openstack.swift.options.CreateContainerOptions

      assertEquals(ImmutableList.of("foo"), options.buildRequestHeaders().get(
          SwiftHeaders.CONTAINER_METADATA_PREFIX + "test"));
   }

   public void testMetadataStatic() {
      CreateContainerOptions options = CreateContainerOptions.Builder
               .withMetadata(ImmutableMap.of("test", "foo"));
      assertEquals(ImmutableList.of("foo"), options.buildRequestHeaders().get(
          SwiftHeaders.CONTAINER_METADATA_PREFIX + "test"));
   }

Examples of org.jclouds.openstack.swift.options.CreateContainerOptions

   @Test(groups = "live")
   public void testCreateDeleteContainerMetadata() throws InterruptedException {
      CommonSwiftClient swift = view.utils().injector().getInstance(CommonSwiftClient.class);

      String containerName = getContainerName();
      CreateContainerOptions options = CreateContainerOptions.Builder
         .withPublicAccess()
         .withMetadata(ImmutableMap.<String, String> of(
            "key1", "value1",
            "key2", "value2",
            "key3", "value3"));

Examples of org.jclouds.openstack.swift.options.CreateContainerOptions

   @Test(groups = "live")
   public void testCreateDeleteContainerMetadata() throws InterruptedException {
      CommonSwiftClient swift = view.utils().injector().getInstance(CommonSwiftClient.class);

      CreateContainerOptions options = CreateContainerOptions.Builder
         .withPublicAccess()
         .withMetadata(ImmutableMap.<String, String> of(
            "key1", "value1",
            "key2", "value2",
            "key3", "value3"));

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

   @Override
   @BeforeClass(groups = "live")
   public void setup() {
      super.setup();
      for (String regionId : api.configuredRegions()) {
         api.containerApiInRegion(regionId).createIfAbsent(name, new CreateContainerOptions());
      }
   }

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

   public void setup() {
      super.setup();
      String key = UUID.randomUUID().toString();
      for (String regionId : api.configuredRegions()) {
         api.accountApiInRegion(regionId).updateTemporaryUrlKey(key);
         api.containerApiInRegion(regionId).createIfAbsent(containerName, new CreateContainerOptions());
         api.objectApiInRegionForContainer(regionId, containerName) //
               .replace(name, newStringPayload("swifty"), ImmutableMap.<String, String> of());
      }
   }

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

   @Override
   @BeforeClass(groups = "live")
   public void setup() {
      super.setup();
      for (String regionId : api.configuredRegions()) {
         api.containerApiInRegion(regionId).createIfAbsent(containerName, new CreateContainerOptions());
         api.objectApiInRegionForContainer(regionId, containerName).replace(name, newStringPayload("swifty"),
               ImmutableMap.<String, String> of());
      }
   }

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

   @BeforeClass(groups = "live")
   public void setup() {
      super.setup();
      for (String regionId : api.configuredRegions()) {
         boolean created = api.containerApiInRegion(regionId).createIfAbsent(containerName,
               new CreateContainerOptions());
         if (!created) {
            deleteAllObjectsInContainer(regionId, containerName);
         }
      }
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.