congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
AccessControlList.toString
Code IndexAdd Tabnine to your IDE (free)

How to use
toString
method
in
org.jclouds.s3.domain.AccessControlList

Best Java code snippets using org.jclouds.s3.domain.AccessControlList.toString (Showing top 12 results out of 315)

origin: jclouds/legacy-jclouds

private void checkGrants(AccessControlList acl) {
 String ownerId = acl.getOwner().getId();
 assertEquals(acl.getGrants().size(), 4, acl.toString());
 assertTrue(acl.hasPermission(ownerId, Permission.FULL_CONTROL), acl.toString());
 assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
 assertTrue(acl.hasPermission(ownerId, Permission.WRITE_ACP), acl.toString());
 // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by email addr
 assertTrue(acl.hasPermission(TEST_ACL_ID, Permission.READ_ACP), acl.toString());
}
origin: jclouds/legacy-jclouds

private void checkGrants(AccessControlList acl) {
 String ownerId = acl.getOwner().getId();
 assertEquals(acl.getGrants().size(), 4, acl.toString());
 assertTrue(acl.hasPermission(ownerId, Permission.FULL_CONTROL), acl.toString());
 assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
 assertTrue(acl.hasPermission(ownerId, Permission.WRITE_ACP), acl.toString());
 // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by email addr
 assertTrue(acl.hasPermission(StubS3AsyncClient.TEST_ACL_ID, Permission.READ_ACP), acl.toString());
}
origin: apache/jclouds

private void checkGrants(AccessControlList acl) {
 String ownerId = acl.getOwner().getId();
 assertEquals(acl.getGrants().size(), 4, acl.toString());
 assertTrue(acl.hasPermission(ownerId, Permission.FULL_CONTROL), acl.toString());
 assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
 assertTrue(acl.hasPermission(ownerId, Permission.WRITE_ACP), acl.toString());
 // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by email addr
 assertTrue(acl.hasPermission(TEST_ACL_ID, Permission.READ_ACP), acl.toString());
}
origin: apache/jclouds

private void checkGrants(AccessControlList acl) {
 String ownerId = acl.getOwner().getId();
 assertEquals(acl.getGrants().size(), 4, acl.toString());
 assertTrue(acl.hasPermission(ownerId, FULL_CONTROL), acl.toString());
 assertTrue(acl.hasPermission(ALL_USERS, READ), acl.toString());
 assertTrue(acl.hasPermission(ownerId, WRITE_ACP), acl.toString());
 // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by email addr
 assertTrue(acl.hasPermission(TEST_ACL_ID, READ_ACP), acl.toString());
}
origin: jclouds/legacy-jclouds

 public void run() {
   try {
    AccessControlList acl = getApi().getBucketACL(bucketName + "eu");
    assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
   } catch (Exception e) {
    Throwables.propagateIfPossible(e);
   }
 }
});
origin: apache/jclouds

 public void run() {
   try {
    AccessControlList acl = getApi().getBucketACL(bucketName + "eu");
    assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
   } catch (Exception e) {
    Throwables.propagateIfPossible(e);
   }
 }
});
origin: jclouds/legacy-jclouds

public void testPublicReadAccessPolicy() throws Exception {
 String bucketName = getScratchContainerName();
 try {
   getApi().putBucketInRegion(null, bucketName, withBucketAcl(CannedAccessPolicy.PUBLIC_READ));
   AccessControlList acl = getApi().getBucketACL(bucketName);
   assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
   // TODO: I believe that the following should work based on the above acl assertion passing.
   // However, it fails on 403
   // URL url = new URL(String.format("http://%s.s3.amazonaws.com", bucketName));
   // Utils.toStringAndClose(url.openStream());
 } finally {
   destroyContainer(bucketName);
 }
}
origin: apache/jclouds

public void testPublicReadAccessPolicy() throws Exception {
 String bucketName = getScratchContainerName();
 try {
   getApi().putBucketInRegion(null, bucketName, withBucketAcl(PUBLIC_READ));
   AccessControlList acl = getApi().getBucketACL(bucketName);
   assertTrue(acl.hasPermission(ALL_USERS, READ), acl.toString());
   // TODO: I believe that the following should work based on the above acl assertion passing.
   // However, it fails on 403
   // URL url = new URL(String.format("http://%s.s3.amazonaws.com", bucketName));
   // Utils.toStringAndClose(url.openStream());
 } finally {
   destroyContainer(bucketName);
 }
}
origin: jclouds/legacy-jclouds

 public void run() {
   try {
    BucketLogging newLogging = getApi().getBucketLogging(bucketName);
    assert newLogging !=null;
    AccessControlList acl = new AccessControlList();
    for (Grant grant : newLogging.getTargetGrants()) { // TODO: add permission
      // checking features to
      // bucketlogging
      acl.addPermission(grant.getGrantee(), grant.getPermission());
    }
    // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by
    // email addr
    assertTrue(acl.hasPermission(StubS3AsyncClient.TEST_ACL_ID, Permission.FULL_CONTROL), acl.toString());
    assertEquals(logging.getTargetBucket(), newLogging.getTargetBucket());
    assertEquals(logging.getTargetPrefix(), newLogging.getTargetPrefix());
   } catch (Exception e) {
    Throwables.propagateIfPossible(e);
   }
 }
});
origin: apache/jclouds

 public void run() {
   try {
    BucketLogging newLogging = getApi().getBucketLogging(bucketName);
    assert newLogging != null;
    AccessControlList acl = new AccessControlList();
    for (Grant grant : newLogging.getTargetGrants()) { // TODO: add permission
      // checking features to
      // bucketlogging
      acl.addPermission(grant.getGrantee(), grant.getPermission());
    }
    // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by
    // email addr
    assertTrue(acl.hasPermission(TEST_ACL_ID, FULL_CONTROL), acl.toString());
    assertEquals(logging.getTargetBucket(), newLogging.getTargetBucket());
    assertEquals(logging.getTargetPrefix(), newLogging.getTargetPrefix());
   } catch (Exception e) {
    Throwables.propagateIfPossible(e);
   }
 }
});
origin: jclouds/legacy-jclouds

  assertEquals(acl.getGrants().size(), 1);
  assertEquals(acl.getPermissions(ownerId).size(), 0);
  assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
} finally {
  returnContainer(containerName);
origin: apache/jclouds

  assertEquals(acl.getGrants().size(), 1);
  assertEquals(acl.getPermissions(ownerId).size(), 0);
  assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
} finally {
  returnContainer(containerName);
org.jclouds.s3.domainAccessControlListtoString

Popular methods of AccessControlList

  • hasPermission
  • <init>
  • addPermission
    Add a permission for the given grantee.
  • getGrants
  • getOwner
  • getPermissions
  • findGrantsForGrantee
    Find all the grants for a given grantee, identified by an ID which allows all Grantee types to be se
  • revokePermission
    Revoke a permission for the given grantee, if this specific permission was granted. Note that you mu
  • setOwner
  • fromCannedAccessPolicy
    Converts a canned access control policy into the equivalent access control list.
  • revokeAllPermissions
    Revoke all the permissions granted to the given grantee.
  • revokeAllPermissions

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Notification (javax.management)
  • JCheckBox (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now