Package com.amazon.s3

Examples of com.amazon.s3.Group


    if (engineGrants != null && 0 < engineGrants.length)
    {
      grants = new Grant[engineGrants.length];
      for(int i = 0; i < engineGrants.length; i++)
      {
        grants[i] = new Grant();
       
        switch( engineGrants[i].getGrantee()) {
        case SAcl.GRANTEE_USER :
           grantee = new CanonicalUser();
           ((CanonicalUser)grantee).setID(engineGrants[i].getCanonicalUserID());
View Full Code Here


        Grant[] grants = null;

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

                switch (engineGrants[i].getGrantee()) {
                    case SAcl.GRANTEE_USER:
                        grantee = new CanonicalUser();
                        ((CanonicalUser)grantee).setID(engineGrants[i].getCanonicalUserID());
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

        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

           ((CanonicalUser)grantee).setDisplayName("TODO");
           grants[i].setGrantee(grantee);
           break;
         
        case SAcl.GRANTEE_ALLUSERS:
           grantee = new Group();
           ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/AllUsers" );
           grants[i].setGrantee(grantee);
             break;
            
        case SAcl.GRANTEE_AUTHENTICATED:       
           grantee = new Group();
           ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/Authenticated" );
           grants[i].setGrantee(grantee);
           break;
         
        default :
View Full Code Here

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

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

                        ((CanonicalUser)grantee).setDisplayName("TODO");
                        grants[i].setGrantee(grantee);
                        break;

                    case SAcl.GRANTEE_ALLUSERS:
                        grantee = new Group();
                        ((Group)grantee).setURI("http://acs.amazonaws.com/groups/global/AllUsers");
                        grants[i].setGrantee(grantee);
                        break;

                    case SAcl.GRANTEE_AUTHENTICATED:
                        grantee = new Group();
                        ((Group)grantee).setURI("http://acs.amazonaws.com/groups/global/Authenticated");
                        grants[i].setGrantee(grantee);
                        break;

                    default:
View Full Code Here

TOP

Related Classes of com.amazon.s3.Group

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.