Examples of CreateContainerOptions


Examples of org.jclouds.blobstore.options.CreateContainerOptions

                return;
            }
        }
        logger.debug("Creating bucket with location: {}", location);

        CreateContainerOptions options = new CreateContainerOptions();
        String acl = request.getHeader("x-amz-acl");
        if ("public-read".equals(acl)) {
            options.publicRead();
        }

        try {
            if (blobStore.createContainerInLocation(location, containerName,
                    options)) {

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 = "unit")
public class CreateContainerOptionsTest {

   public void testPublicAccess() {
      CreateContainerOptions options = new CreateContainerOptions().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 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);

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

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

   }

   private void createContainer() {
      System.out.println("Create Container");

      CreateContainerOptions options = CreateContainerOptions.Builder
            .withMetadata(ImmutableMap.of("key1", "value1", "key2", "value2"));

      swift.getApi().createContainer(Constants.CONTAINER, options);

      System.out.println("  " + Constants.CONTAINER);

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

*/
@Test(groups = "unit")
public class CreateContainerOptionsTest {

   public void testPublicAccess() {
      CreateContainerOptions options = new CreateContainerOptions().withPublicAccess();
      assertEquals(ImmutableList.of(".r:*,.rlistings"),
               options.buildRequestHeaders().get("X-Container-Read"));
   }
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.