Package org.jclouds.aws.s3.binders

Examples of org.jclouds.aws.s3.binders.BindObjectMetadataToRequestTest


      provider = "aws-s3";
   }
  
   @Override
   public ProviderMetadata createProviderMetadata() {
      return new AWSS3ProviderMetadata();
   }
View Full Code Here


      provider = "aws-s3";
   }
  
   @Override
   public ProviderMetadata createProviderMetadata() {
      return new AWSS3ProviderMetadata();
   }
View Full Code Here

            map.putFile(blobName, file);
            // TODO: magic! in order to expose the blob as public, we need to dive into provider specific APIs
            // the hope is that permissions are encapsulated in jclouds in the future
            if (provider.equals("s3"))
            {
                S3Client sss = context.<S3Client,S3AsyncClient>getProviderSpecificContext().getApi();
                String ownerId = sss.getObjectACL(container, blobName).getOwner().getId();
                sss.putObjectACL(container,
                                 blobName,
                                 AccessControlList.fromCannedAccessPolicy(CannedAccessPolicy.PUBLIC_READ, ownerId));
            }
            else
                LOG.warn(provider + " may not be properly supported for tarball transfer.");
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private ListenableFuture<String> putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getAsyncApi().putObject(container,
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private String putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi().putObject(container, blob2Object.apply(blob),
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private ListenableFuture<String> putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getAsyncApi().putObject(container,
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private String putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi().putObject(container, blob2Object.apply(blob),
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private String putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi().putObject(container, blob2Object.apply(blob),
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private ListenableFuture<String> putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getAsyncApi().putObject(container,
View Full Code Here

         return super.putBlob(container, blob, options);
      }
   }

   private String putBlobWithReducedRedundancy(String container, Blob blob) {
      AWSS3PutObjectOptions options = new AWSS3PutObjectOptions();
      try {
         AccessControlList acl = bucketAcls.getUnchecked(container);
         if (acl != null && acl.hasPermission(AccessControlList.GroupGranteeURI.ALL_USERS,
                                              AccessControlList.Permission.READ)) {
            options.withAcl(CannedAccessPolicy.PUBLIC_READ);
         }
         options.storageClass(ObjectMetadata.StorageClass.REDUCED_REDUNDANCY);

      } catch (CacheLoader.InvalidCacheLoadException e) {
         // nulls not permitted from cache loader
      }
      return getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi().putObject(container, blob2Object.apply(blob),
View Full Code Here

TOP

Related Classes of org.jclouds.aws.s3.binders.BindObjectMetadataToRequestTest

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.