Search in sources :

Example 61 with Group

use of org.gluu.oxtrust.model.scim2.Group in project bioformats by openmicroscopy.

the class NetCDFServiceImpl method getAttributeValue.

/* (non-Javadoc)
   * @see loci.formats.NetCDFService#getAttributeValue(java.lang.String)
   */
@Override
public String getAttributeValue(String path) {
    String groupName = getDirectory(path);
    String attributeName = getName(path);
    Group group = getGroup(groupName);
    Attribute attribute = group.findAttribute(attributeName);
    if (attribute == null)
        return null;
    return arrayToString(attribute.getValues());
}
Also used : Group(ucar.nc2.Group) Attribute(ucar.nc2.Attribute)

Example 62 with Group

use of org.gluu.oxtrust.model.scim2.Group in project bioformats by openmicroscopy.

the class NetCDFServiceImpl method getGroup.

/**
 * Retrieves a group based on its fully qualified path.
 * @param path Fully qualified path to the group.
 * @return Group or <code>root</code> if the group cannot be found.
 */
private Group getGroup(String path) {
    if (path.indexOf('/') == -1) {
        return root;
    }
    StringTokenizer tokens = new StringTokenizer(path, "/");
    Group parent = root;
    while (tokens.hasMoreTokens()) {
        String token = tokens.nextToken();
        Group nextParent = parent.findGroup(token);
        if (nextParent == null) {
            break;
        }
        parent = nextParent;
    }
    return parent == null ? root : parent;
}
Also used : Group(ucar.nc2.Group) StringTokenizer(java.util.StringTokenizer)

Aggregations

ArrayList (java.util.ArrayList)18 GluuGroup (org.gluu.oxtrust.model.GluuGroup)14 DefaultValue (javax.ws.rs.DefaultValue)13 HeaderParam (javax.ws.rs.HeaderParam)13 Produces (javax.ws.rs.Produces)13 Response (javax.ws.rs.core.Response)13 URI (java.net.URI)12 ListResponse (org.gluu.oxtrust.model.scim2.ListResponse)12 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)11 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)10 Path (javax.ws.rs.Path)8 Group (org.gluu.oxtrust.model.scim2.Group)8 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)8 Group (org.openstack4j.model.identity.v3.Group)8 Group (ucar.nc2.Group)8 InvalidAttributeValueException (javax.management.InvalidAttributeValueException)7 Consumes (javax.ws.rs.Consumes)7 ListViewResponse (org.gluu.persist.model.ListViewResponse)7 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)6 SCIMException (org.gluu.oxtrust.model.exception.SCIMException)6