Package org.jclouds.openstack.swift.v1.options

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


   @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());
      }
   }
View Full Code Here


   @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");
View Full Code Here

   @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);
         }
      }
      megOf1s = new byte[1024 * 1024];
 
View Full Code Here

      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(new MockResponse().setResponseCode(201));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.containerApiInRegion("DFW").createIfAbsent("myContainer", new CreateContainerOptions()));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest createRequest = server.takeRequest();
         assertEquals(createRequest.getRequestLine(),
View Full Code Here

      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(new MockResponse().setResponseCode(202));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertFalse(api.containerApiInRegion("DFW").createIfAbsent("myContainer", new CreateContainerOptions()));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest createRequest = server.takeRequest();
         assertEquals(createRequest.getRequestLine(),
View Full Code Here

   public void testCreateWithOptions() throws Exception {
      for (String regionId : regions) {
         ImmutableMultimap<String, String> headers =
               ImmutableMultimap.of(SwiftHeaders.STATIC_WEB_INDEX, "__index.html",
                                    SwiftHeaders.STATIC_WEB_ERROR, "__error.html");
         CreateContainerOptions opts = new CreateContainerOptions().headers(headers);

         assertNotNull(api.getContainerApiForRegion(regionId).create(name, opts));

         Container container = api.getContainerApiForRegion(regionId).get(name);
         assertNotNull(container);
View Full Code Here

      Multimap<String, String> enableStaticWebHeaders =
            ImmutableMultimap.of(STATIC_WEB_INDEX, FILENAME + SUFFIX,
                                 STATIC_WEB_ERROR, "error.html");

      CreateContainerOptions opts = new CreateContainerOptions().headers(enableStaticWebHeaders);
      cloudFiles.getContainerApiForRegion(REGION).create(CONTAINER_PUBLISH, opts);

      System.out.format("  %s%n", CONTAINER_PUBLISH);
   }
View Full Code Here

      Multimap<String, String> headers = ImmutableMultimap.of(
            "Access-Control-Allow-Origin", "*",
            "Access-Control-Max-Age", "600",
            "Access-Control-Allow-Headers", "X-My-Header");
      CreateContainerOptions options = CreateContainerOptions.Builder.headers(headers);

      containerApi.create(CONTAINER, options);
      System.out.format("  %s%n", CONTAINER);

      Container container = containerApi.get(CONTAINER);
View Full Code Here

   }

   private void createContainer() {
      System.out.format("Create Container%n");

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

      cloudFiles.getContainerApiForRegion(REGION).create(CONTAINER, options);

      System.out.format("  %s%n", CONTAINER);
View Full Code Here

   public void testCreateWithOptions() throws Exception {
      for (String regionId : regions) {
         ImmutableMultimap<String, String> headers =
               ImmutableMultimap.of(SwiftHeaders.STATIC_WEB_INDEX, "__index.html",
                                    SwiftHeaders.STATIC_WEB_ERROR, "__error.html");
         CreateContainerOptions opts = new CreateContainerOptions().headers(headers);

         assertNotNull(api.getContainerApi(regionId).create(name, opts));

         Container container = api.getContainerApi(regionId).get(name);
         assertNotNull(container);
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.v1.options.CreateContainerOptions$Builder

Copyright © 2018 www.massapicom. 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.