use of org.apache.jackrabbit.spi.commons.privilege.PrivilegeDefinitionReader in project jackrabbit by apache.
the class AbstractRecord method readPrivilegeDef.
/**
* {@inheritDoc}
*/
public PrivilegeDefinition readPrivilegeDef() throws JournalException {
try {
StringReader sr = new StringReader(readString());
PrivilegeDefinitionReader reader = new PrivilegeDefinitionReader(sr, "text/xml");
PrivilegeDefinition[] defs = reader.getPrivilegeDefinitions();
if (defs.length != 1) {
throw new JournalException("Expected one privilege definition: got " + defs.length);
}
return defs[0];
} catch (org.apache.jackrabbit.spi.commons.privilege.ParseException e) {
String msg = "Parse error while reading privilege definition.";
throw new JournalException(msg, e);
}
}
Aggregations