Package org.jclouds.s3

Examples of org.jclouds.s3.S3ApiMetadata$Builder


      super();
   }

   @Override
   public S3ApiMetadata createApiMetadata() {
      return new S3ApiMetadata();
   }
View Full Code Here


      return new TestS3RestClientModule();
   }
  
   @Override
   public S3ApiMetadata createApiMetadata() {
      return new S3ApiMetadata();
   }
View Full Code Here

      super();
   }

   @Override
   public S3ApiMetadata createApiMetadata() {
      return new S3ApiMetadata();
   }
View Full Code Here

      return new TestS3HttpApiModule();
   }
  
   @Override
   public S3ApiMetadata createApiMetadata() {
      return new S3ApiMetadata();
   }
View Full Code Here

               // and must be automatically converted to their path-based equivalent.  This should only be possible for
               // AWS-S3 since it is the only S3 implementation configured to allow uppercase payload/bucket/container
               // names.
               //
               // http://code.google.com/p/jclouds/issues/detail?id=992
               URI defaultS3Endpoint = URI.create(new S3ApiMetadata().getDefaultEndpoint().get());
               URI requestEndpoint = command.getCurrentRequest().getEndpoint();
               boolean wasPathBasedRequest = requestEndpoint.getHost().contains(defaultS3Endpoint.getHost()) &&
                     requestEndpoint.getHost().equals(defaultS3Endpoint.getHost());

               exception = new ResourceNotFoundException(message, exception);
View Full Code Here

                        CONSTANT_DATE).put("Authorization", "AWS identity:ZWVz2v/jGB+ZMmijoyfH9mFMPo0=").build())
               .build();

      HttpResponse success = HttpResponse.builder().statusCode(200).build();

      S3Client clientWhenBucketExists = requestsSendResponses(bucketFooExists, redirectResponse, bucketFooExistsNowUsesGET, success);
     
      assert clientWhenBucketExists.bucketExists("foo");

   }
View Full Code Here

         Blob blob = blobStore.blobBuilder(blobName).payload("something").build();
         blobStore.putBlob(containerName, blob,
            storageClass(StorageClass.REDUCED_REDUNDANCY));

         S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

         ObjectMetadata metadata = response.iterator().next();
         assertEquals(metadata.getStorageClass(), StorageClass.REDUCED_REDUNDANCY);

      } finally {
View Full Code Here

         Blob blob = blobStore.blobBuilder(blobName).payload("something").build();
         blobStore.putBlob(containerName, blob,
            storageClass(StorageClass.REDUCED_REDUNDANCY));

         S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

         ObjectMetadata metadata = response.iterator().next();
         assertEquals(metadata.getStorageClass(), StorageClass.REDUCED_REDUNDANCY);

      } finally {
View Full Code Here

    private S3BlobStore s3BlobStore;

    //TODO: does all of this behavior belong on AWSClient?

    public S3TestUtils(ConnectionCredentials connectionCredentials) {
        S3BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("aws-s3")
                .credentials(connectionCredentials.getIdentity(), connectionCredentials.getCredential())
                .modules(ImmutableSet.<Module>of(new SLF4JLoggingModule()))
                .buildView(S3BlobStoreContext.class);
        s3BlobStore = blobStoreContext.getBlobStore();
    }
View Full Code Here

   @Test
   public void testPutWithReducedRedundancy() {
      Injector injector = createInjector(Functions.forMap(ImmutableMap.<HttpRequest, HttpResponse>of()), createModule(), setupProperties());

      Blob blob = injector.getInstance(BlobBuilder.class).name("test").payload("content").build();
      BlobToObject blobToObject = injector.getInstance(BlobToObject.class);

      AWSS3Client client = requestsSendResponses(bucketLocationRequest, bucketLocationResponse,
         HttpRequest.builder()
                    .method("PUT")
                    .endpoint("https://test.s3-eu-west-1.amazonaws.com/test")
                    .addHeader("Expect", "100-continue")
                    .addHeader("x-amz-storage-class", "REDUCED_REDUNDANCY")
                    .addHeader("Host", "test.s3-eu-west-1.amazonaws.com")
                    .addHeader("Date", CONSTANT_DATE)
                    .addHeader("Authorization", "AWS identity:1mJrW85/mqZpYTFIK5Ebtt2MM6E=")
                    .payload("content").build(),
         HttpResponse.builder()
                     .statusCode(200)
                     .addHeader("x-amz-id-2", "w0rL+9fALQiCOToesVQefs8WalIgn+ZhMD7hHMKYud/xv7MyKkAWQOtFNEfK97Ri")
                     .addHeader("x-amz-request-id", "7A84C3CD4437A4C0")
                     .addHeader("Date", CONSTANT_DATE)
                     .addHeader("ETag", "437b930db84b8079c2dd804a71936b5f")
                     .addHeader("Server", "AmazonS3").build()
      );

      client.putObject("test", blobToObject.apply(blob),
         storageClass(StorageClass.REDUCED_REDUNDANCY));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.s3.S3ApiMetadata$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.