Package org.jclouds.s3.domain

Examples of org.jclouds.s3.domain.AccessControlList$Grantee


    {
      for (Grant grant: grants)
      {
        S3Grant engineGrant = new S3Grant();

        Grantee grantee = grant.getGrantee();
        if (grantee instanceof CanonicalUser)
        {
          engineGrant.setGrantee(SAcl.GRANTEE_USER);
          engineGrant.setCanonicalUserID(((CanonicalUser)grantee).getID());
        }
        else if (grantee instanceof Group)
        {
           Group temp = (Group)grantee;
           String uri = temp.getURI();
           if ( uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/AllUsers" )) {
              // -> this allows all public unauthenticated access based on permission given
              engineGrant.setGrantee(SAcl.GRANTEE_ALLUSERS);
              engineGrant.setCanonicalUserID( "*" );
           }
           else if (uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/Authenticated" )) {
              // -> this allows any authenticated user access based on permission given
              engineGrant.setGrantee(SAcl.GRANTEE_AUTHENTICATED);
              engineGrant.setCanonicalUserID( "A" );
           }
           else throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri );

        }
        else throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName());
       
        Permission permission = grant.getPermission();
        String permissionValue = permission.getValue();
        if(permissionValue.equalsIgnoreCase("READ")) {
          engineGrant.setPermission(SAcl.PERMISSION_READ);
View Full Code Here


    }
    return engineAcl;
  }
 
  private static Grant[] toGrants(S3Grant[] engineGrants) {
    Grantee grantee = null;
    Grant[] grants  = null;

    if (engineGrants != null && 0 < engineGrants.length)
    {
      grants = new Grant[engineGrants.length];
View Full Code Here

        Grant[] grants = acl.getGrant();
        if (grants != null) {
            for (Grant grant : grants) {
                S3Grant engineGrant = new S3Grant();

                Grantee grantee = grant.getGrantee();
                if (grantee instanceof CanonicalUser) {
                    engineGrant.setGrantee(SAcl.GRANTEE_USER);
                    engineGrant.setCanonicalUserID(((CanonicalUser)grantee).getID());
                } else if (grantee instanceof Group) {
                    Group temp = (Group)grantee;
                    String uri = temp.getURI();
                    if (uri.equalsIgnoreCase("http://acs.amazonaws.com/groups/global/AllUsers")) {
                        // -> this allows all public unauthenticated access based on permission given
                        engineGrant.setGrantee(SAcl.GRANTEE_ALLUSERS);
                        engineGrant.setCanonicalUserID("*");
                    } else if (uri.equalsIgnoreCase("http://acs.amazonaws.com/groups/global/Authenticated")) {
                        // -> this allows any authenticated user access based on permission given
                        engineGrant.setGrantee(SAcl.GRANTEE_AUTHENTICATED);
                        engineGrant.setCanonicalUserID("A");
                    } else
                        throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri);

                } else
                    throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName());

                Permission permission = grant.getPermission();
                String permissionValue = permission.getValue();
                if (permissionValue.equalsIgnoreCase("READ")) {
                    engineGrant.setPermission(SAcl.PERMISSION_READ);
View Full Code Here

        }
        return engineAcl;
    }

    private static Grant[] toGrants(S3Grant[] engineGrants) {
        Grantee grantee = null;
        Grant[] grants = null;

        if (engineGrants != null && 0 < engineGrants.length) {
            grants = new Grant[engineGrants.length];
            for (int i = 0; i < engineGrants.length; i++) {
View Full Code Here

    {
      for (Grant grant: grants)
      {
        S3Grant engineGrant = new S3Grant();

        Grantee grantee = grant.getGrantee();
        if (grantee instanceof CanonicalUser)
        {
          engineGrant.setGrantee(SAcl.GRANTEE_USER);
          engineGrant.setCanonicalUserID(((CanonicalUser)grantee).getID());
        }
        else if (grantee instanceof Group)
        {
           Group temp = (Group)grantee;
           String uri = temp.getURI();
           if ( uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/AllUsers" )) {
              // -> this allows all public unauthenticated access based on permission given
              engineGrant.setGrantee(SAcl.GRANTEE_ALLUSERS);
              engineGrant.setCanonicalUserID( "*" );
           }
           else if (uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/Authenticated" )) {
              // -> this allows any authenticated user access based on permission given
              engineGrant.setGrantee(SAcl.GRANTEE_AUTHENTICATED);
              engineGrant.setCanonicalUserID( "A" );
           }
           else throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri );

        }
        else throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName());
       
        Permission permission = grant.getPermission();
        String permissionValue = permission.getValue();
        if(permissionValue.equalsIgnoreCase("READ")) {
          engineGrant.setPermission(SAcl.PERMISSION_READ);
View Full Code Here

    }
    return engineAcl;
  }
 
  private static Grant[] toGrants(S3Grant[] engineGrants) {
    Grantee grantee = null;
    Grant[] grants  = null;

    if (engineGrants != null && 0 < engineGrants.length)
    {
      grants = new Grant[engineGrants.length];
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("greenqloud-storage")
         .name("GreenQloud Simple Storage Service (S3)")
         .apiMetadata(new S3ApiMetadata())
         .homepage(URI.create("http://www.greenqloud.com"))
         .console(URI.create("https://manage.greenqloud.com"))
         .linkedServices("greenqloud-compute", "greenqloud-storage")
         .iso3166Codes("IS-1")
         .endpoint("https://s.greenqloud.com")
View Full Code Here

*/
@Test(groups = "unit", testName = "GreenQloudStorageProviderTest")
public class GreenQloudStorageProviderTest extends BaseProviderMetadataTest {

   public GreenQloudStorageProviderTest() {
      super(new GreenQloudStorageProviderMetadata(), new S3ApiMetadata());
   }
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

         keyToAcl.put(bucketName + "/" + object.getMetadata().getKey(), options.getAcl());
      return blobStore.putBlob(bucketName, object2Blob.apply(object));
   }

   protected AccessControlList getACLforS3Item(String bucketAndObjectKey) {
      AccessControlList acl = null;
      Object aclObj = keyToAcl.get(bucketAndObjectKey);
      if (aclObj instanceof AccessControlList) {
         acl = (AccessControlList) aclObj;
      } else if (aclObj instanceof CannedAccessPolicy) {
         acl = AccessControlList.fromCannedAccessPolicy((CannedAccessPolicy) aclObj, DEFAULT_OWNER_ID);
View Full Code Here

TOP

Related Classes of org.jclouds.s3.domain.AccessControlList$Grantee

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.