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

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

Introduction

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

Prototype

Permission

Source Link

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());
        }// w ww.j  a v a  2  s . c o m
        p.setAccess(accessList);

        permissions.add(p);
    }

    return permissions;
}