Example usage for com.amazonaws.services.s3.model Owner getId

List of usage examples for com.amazonaws.services.s3.model Owner getId

Introduction

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

Prototype

public String getId() 

Source Link

Document

Gets the ID of the owner.

Usage

From source file:com.upplication.s3fs.S3FileSystemProvider.java

License:Open Source License

/**
 * check if the param acl has the same owner than the parameter owner and
 * have almost one of the permission set in the parameter permissions
 * @param acl//from   www .  ja v  a2 s  . c o m
 * @param owner
 * @param permissions almost one
 * @return
 */
private boolean hasPermissions(AccessControlList acl, Owner owner, EnumSet<Permission> permissions) {
    boolean result = false;
    for (Grant grant : acl.getGrants()) {
        if (grant.getGrantee().getIdentifier().equals(owner.getId())
                && permissions.contains(grant.getPermission())) {
            result = true;
            break;
        }
    }
    return result;
}