Example usage for com.amazonaws.services.elastictranscoder.model Permission setAccess

List of usage examples for com.amazonaws.services.elastictranscoder.model Permission setAccess

Introduction

In this page you can find the example usage for com.amazonaws.services.elastictranscoder.model Permission setAccess.

Prototype


public void setAccess(java.util.Collection<String> access) 

Source Link

Document

The permission that you want to give to the AWS user that is listed in Grantee.

Usage

From source file:org.alanwilliamson.amazon.transcoder.pipeline.Create.java

License:Open Source License

private Collection<Permission> getPermissions(cfSession _session, cfStructData cc) throws cfmRunTimeException {
    List<Permission> permissions = new LinkedList<Permission>();

    if (!cc.containsKey("permissions"))
        return permissions;

    cfArrayData arr = (cfArrayData) cc.getData("permissions");

    for (int x = 0; x < arr.size(); x++) {
        cfStructData cs = (cfStructData) arr.getData(x + 1);

        Permission p = new Permission();

        p.setGranteeType(cs.getData("granteetype").getString());
        p.setGrantee(cs.getData("grantee").getString());

        cfArrayData access = (cfArrayData) cs.getData("access");
        List<String> accessList = new LinkedList<String>();

        for (int a = 0; a < access.size(); a++) {
            accessList.add(access.getData(a + 1).getString());
        }//  ww w.ja  v a2  s .  c o  m
        p.setAccess(accessList);

        permissions.add(p);
    }

    return permissions;
}