use of org.apache.jena.permissions.utils.PermStatementFilter in project jena by apache.
the class SecuredResourceImpl method getProperty.
@Override
public SecuredStatement getProperty(Property p, String lang) throws ReadDeniedException, AuthenticationRequiredException {
checkRead();
final ExtendedIterator<Statement> iter = holder.getBaseItem().listProperties(p, lang).filterKeep(new PermStatementFilter(Action.Read, this));
try {
if (iter.hasNext()) {
return org.apache.jena.permissions.model.impl.SecuredStatementImpl.getInstance(getModel(), iter.next());
} else {
return null;
}
} finally {
iter.close();
}
}
use of org.apache.jena.permissions.utils.PermStatementFilter in project jena by apache.
the class SecuredResourceImpl method getRequiredProperty.
@Override
public SecuredStatement getRequiredProperty(Property p, String lang) throws PropertyNotFoundException, ReadDeniedException, AuthenticationRequiredException {
checkRead();
final ExtendedIterator<Statement> iter = holder.getBaseItem().listProperties(p, lang).filterKeep(new PermStatementFilter(Action.Read, this));
try {
if (iter.hasNext()) {
return org.apache.jena.permissions.model.impl.SecuredStatementImpl.getInstance(getModel(), iter.next());
} else {
throw new PropertyNotFoundException(p);
}
} finally {
iter.close();
}
}
Aggregations