最近更新时间:2021-09-18
以下代码用于获取文件的访问权限:
public void testGetObjectAcl() { try { AccessControlList acl = s3.getObjectAcl(bucketName, objectName); List grants = acl.getGrantsAsList(); for (Grant grant : grants) { System.out.format("%s\n", grant.getPermission().toString()); } } catch (AmazonServiceException e) { System.err.println(e.getErrorMessage()); System.exit(1); } System.out.println("Done!"); }
public void testGetObjectAcl() { try { AccessControlList acl = s3.getObjectAcl(bucketName, objectName); List for (Grant grant : grants) { System.out.format("%s\n", grant.getPermission().toString()); } } catch (AmazonServiceException e) { System.err.println(e.getErrorMessage()); System.exit(1); } System.out.println("Done!"); } |