Package org.jets3t.service.acl

Examples of org.jets3t.service.acl.CanonicalGrantee


        // TEST DATA
        AccessControlList acl = new AccessControlList();
        S3Owner owner = new S3Owner("1234567890", "Some Name");
        acl.setOwner(owner);

        GranteeInterface grantee = new CanonicalGrantee();
        grantee.setIdentifier("zzz");
        acl.grantPermission(grantee, Permission.PERMISSION_WRITE);

        grantee = new CanonicalGrantee();
        grantee.setIdentifier("abc");
        ((CanonicalGrantee)grantee).setDisplayName("jamesmurty");
        acl.grantPermission(grantee, Permission.PERMISSION_FULL_CONTROL);
        grantee = new CanonicalGrantee();
        grantee.setIdentifier("aaa");
        acl.grantPermission(grantee, Permission.PERMISSION_READ);
        grantee = GroupGrantee.ALL_USERS;
        acl.grantPermission(grantee, Permission.PERMISSION_READ);
        grantee = GroupGrantee.AUTHENTICATED_USERS;
        acl.grantPermission(grantee, Permission.PERMISSION_WRITE);
        grantee = new EmailAddressGrantee();
        grantee.setIdentifier("james@test.com");
        acl.grantPermission(grantee, Permission.PERMISSION_READ);
        grantee = new EmailAddressGrantee();
        grantee.setIdentifier("james@test2.com");
        acl.grantPermission(grantee, Permission.PERMISSION_FULL_CONTROL);

        JFrame f = new JFrame("Cockpit");
        S3Bucket bucket = new S3Bucket();
        bucket.setName("SomeReallyLongAndWackyBucketNamePath.HereItIs");
View Full Code Here


            // New object to insert.
            currentGrantees.add(insertRow, gap);
            if (grantee instanceof GroupGrantee) {
                this.insertRow(insertRow, new Object[] {grantee, permission});
            } else if (grantee instanceof CanonicalGrantee) {
                CanonicalGrantee canonicalGrantee = (CanonicalGrantee) grantee;
                this.insertRow(insertRow, new Object[] {canonicalGrantee.getIdentifier(),
                    canonicalGrantee.getDisplayName(), permission});
            } else {
                this.insertRow(insertRow, new Object[] {grantee.getIdentifier(), permission});
            }
            return insertRow;
        }
View Full Code Here

                bucketLoggingStatus.setTargetBucketName(targetBucket);
                bucketLoggingStatus.setLogfilePrefix(targetPrefix);
            }
            // Handle TargetGrants ACLs
            else if (name.equals("ID")) {
                currentGrantee = new CanonicalGrantee();
                currentGrantee.setIdentifier(elementText);
            } else if (name.equals("EmailAddress")) {
                currentGrantee = new EmailAddressGrantee();
                currentGrantee.setIdentifier(elementText);
            } else if (name.equals("URI")) {
View Full Code Here

        } else if (name.equals("DisplayName") && !insideACL) {
            owner.setDisplayName(elementText);
        }
        // ACL details.
        else if (name.equals("ID")) {
            currentGrantee = new CanonicalGrantee();
            currentGrantee.setIdentifier(elementText);
        } else if (name.equals("EmailAddress")) {
            currentGrantee = new EmailAddressGrantee();
            currentGrantee.setIdentifier(elementText);
        } else if (name.equals("URI")) {
View Full Code Here

        Set<GrantAndPermission> grants = new HashSet<GrantAndPermission>(Arrays.asList(acl.getGrantAndPermissions()));
        assertEquals(grants.size(), 3);
        Set<GrantAndPermission> grantSet = new HashSet<GrantAndPermission>();
        for (int i = 1; i <= 3; ++i) {
            grantSet.add(new GrantAndPermission(new CanonicalGrantee(Integer.toString(i)), Permission.PERMISSION_READ));
        }
    }
View Full Code Here

        for (int i = 0; i < s3AclRetries; ++i) {
            try {
                AccessControlList acl = s3Service.getObjectAcl(object.getBucketName(), object.getKey());
                for (String id : s3Acl.split(",")) {
                    acl.grantPermission(new CanonicalGrantee(id), Permission.PERMISSION_READ);
                }
                s3Service.putObjectAcl(object.getBucketName(), object.getKey(), acl);
                return true;
            } catch (Exception e) {
                log.error("Exception while granting ACL: " + e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.jets3t.service.acl.CanonicalGrantee

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.