use of org.apache.jena.shared.AuthenticationRequiredException in project jena by apache.
the class SecuredModelImpl method add.
/**
* @sec.graph Update
* @sec.triple Create all the statements as triples.
* @throws UpdateDeniedException
* @throws AddDeniedException
* @throws AuthenticationRequiredException if user is not authenticated and is
* required to be.
*/
@Override
public SecuredModel add(final StmtIterator iter) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
checkUpdate();
StmtIterator updateFrom = iter;
if (!canCreate(Triple.ANY)) {
// checkCreate will throw exception on first failure
List<Statement> stmt = iter.filterKeep(s -> {
checkCreate(s);
return true;
}).toList();
// now just add the list to the base
updateFrom = new StmtIteratorImpl(stmt.iterator());
}
holder.getBaseItem().add(updateFrom);
return holder.getSecuredItem();
}
Aggregations