Example usage for com.amazonaws.services.s3.model Grantee Grantee

List of usage examples for com.amazonaws.services.s3.model Grantee Grantee

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model Grantee Grantee.

Prototype

Grantee

Source Link

Usage

From source file:com.upplication.s3fs.util.AmazonS3ClientMock.java

License:Open Source License

private AccessControlList createAllPermission() {
    AccessControlList res = new AccessControlList();
    res.setOwner(getS3AccountOwner());//from w  w w.  j  a va  2s.co m
    Grantee grant = new Grantee() {

        @Override
        public void setIdentifier(String id) {
        }

        @Override
        public String getTypeIdentifier() {
            return getS3AccountOwner().getId();
        }

        @Override
        public String getIdentifier() {
            return getS3AccountOwner().getId();
        }
    };

    res.grantPermission(grant, Permission.FullControl);
    res.grantPermission(grant, Permission.Read);
    res.grantPermission(grant, Permission.Write);
    return res;
}