Package org.jets3t.service.acl

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()


              if (log.isWarnEnabled()) {
                  log.warn("Target logging bucket '" + status.getTargetBucketName()
                      + "' does not have the necessary ACL settings, updating ACL now");
              }
             
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_WRITE);
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_READ_ACP);
                putBucketAcl(status.getTargetBucketName(), logBucketACL);
            } else {
              if (log.isDebugEnabled()) {
                  log.debug("Target logging bucket '" + status.getTargetBucketName()
View Full Code Here


                  log.warn("Target logging bucket '" + status.getTargetBucketName()
                      + "' does not have the necessary ACL settings, updating ACL now");
              }
             
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_WRITE);
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_READ_ACP);
                putBucketAcl(status.getTargetBucketName(), logBucketACL);
            } else {
              if (log.isDebugEnabled()) {
                  log.debug("Target logging bucket '" + status.getTargetBucketName()
                      + "' has the necessary ACL settings");
View Full Code Here

        s3Service.createBucket(publicBucket);
       
        // Retrieve the bucket's ACL and modify it to grant public access,
        // ie READ access to the ALL_USERS group.
        AccessControlList bucketAcl = s3Service.getBucketAcl(publicBucket);
        bucketAcl.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ);
       
        // Update the bucket's ACL. Now anyone can view the list of objects in this bucket.
        publicBucket.setAcl(bucketAcl);
        s3Service.putBucketAcl(publicBucket);
        System.out.println("View bucket's object listing here: http://s3.amazonaws.com/"
View Full Code Here

        // for a fuller discussion of these settings.
       
        AccessControlList acl = new AccessControlList();
       
        // Grant access by email address. Note that this only works email address of AWS S3 members.
        acl.grantPermission(new EmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);
       
        // Grant control of ACL settings to a known AWS S3 member.
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_READ_ACP);
View Full Code Here

        // Grant access by email address. Note that this only works email address of AWS S3 members.
        acl.grantPermission(new EmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);
       
        // Grant control of ACL settings to a known AWS S3 member.
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_READ_ACP);
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_WRITE_ACP);
       
    
View Full Code Here

            Permission.PERMISSION_FULL_CONTROL);
       
        // Grant control of ACL settings to a known AWS S3 member.
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_READ_ACP);
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_WRITE_ACP);
       
    
        /*
         * Temporarily make an Object available to anyone
View Full Code Here

              if (log.isWarnEnabled()) {
                  log.warn("Target logging bucket '" + status.getTargetBucketName()
                      + "' does not have the necessary ACL settings, updating ACL now");
              }
             
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_WRITE);
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_READ_ACP);
                putBucketAcl(status.getTargetBucketName(), logBucketACL);
            } else {
              if (log.isDebugEnabled()) {
                  log.debug("Target logging bucket '" + status.getTargetBucketName()
View Full Code Here

                  log.warn("Target logging bucket '" + status.getTargetBucketName()
                      + "' does not have the necessary ACL settings, updating ACL now");
              }
             
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_WRITE);
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_READ_ACP);
                putBucketAcl(status.getTargetBucketName(), logBucketACL);
            } else {
              if (log.isDebugEnabled()) {
                  log.debug("Target logging bucket '" + status.getTargetBucketName()
                      + "' has the necessary ACL settings");
View Full Code Here

        // Create a public object.
        String publicKey = "Public Object #1";
        object = new S3Object(bucket, publicKey, "Public object sample text");       
        AccessControlList acl = new AccessControlList();
        acl.setOwner(bucketOwner);
        acl.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ);
        object.setAcl(acl);
        s3Service.putObject(bucket, object);
        url = new URL(s3Url + "/" + bucketName + "/" + RestUtils.encodeUrlString(publicKey));
        assertEquals("Expected access (200)",
                200, ((HttpURLConnection)url.openConnection()).getResponseCode());
View Full Code Here

        assertEquals("Expected access (200)",
                200, ((HttpURLConnection)url.openConnection()).getResponseCode());

        // Update ACL to make private object public.
        AccessControlList privateToPublicACL = s3Service.getObjectAcl(bucket, privateKey);
        privateToPublicACL.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ);
        object.setKey(privateKey);
        object.setAcl(privateToPublicACL);
        s3Service.putObjectAcl(bucket, object);
        url = new URL(s3Url + "/" + bucketName + "/" + RestUtils.encodeUrlString(privateKey));
        assertEquals("Expected access (200)", 200, ((HttpURLConnection) url.openConnection())
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.