public void setCorrelation(double correlation) { if (a.equals(b)) { if (Math.abs(correlation - 1D) > EPSILON) { throw new InconsistentException(...); } this.correlation = 1D; } else { this.correlation= correlation; } }
/** * @inheritDoc */ public void clearGroupAccess() throws InconsistentException, PermissionException { if(this.m_access != AccessMode.GROUPED) { throw new InconsistentException(this.getReference()); } if(this.m_groups.size() > 0) { this.m_accessUpdated = true; } this.m_access = AccessMode.INHERITED; this.m_groups.clear(); }
/** * @inheritDoc * @see org.sakaiproject.content.api.GroupAwareEdit#addRoleAccess(String) */ public void addRoleAccess(String roleId) throws InconsistentException, PermissionException { if (roleId == null || roleId.isEmpty()) { throw new InconsistentException("BasicGroupAwareEdit#addRoleAccess - Must specify a role to remove for content " + this.getReference()); } if (!this.getInheritedGroups().isEmpty()) { throw new InconsistentException(String.format("BasicGroupAwareEdit#addRoleAccess: could not assign role %s because content %s inherits group access.", roleId, this.getReference())); } if (getInheritedRoleAccessIds().contains(roleId)) { throw new InconsistentException(String.format("BasicGroupAwareEdit#addRoleAccess: could not assign role %s because content %s inherits role access.", roleId, this.getReference())); } if (!(isRoleView(this.m_id, roleId))) { try { setRoleView(this.m_id, roleId, true); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } this.m_accessUpdated = true; this.m_access = AccessMode.INHERITED; this.m_groups.clear(); } }
throw new InconsistentException(this.getReference()); throw new InconsistentException(this.getReference());
/** * @inheritDoc * @see org.sakaiproject.content.api.GroupAwareEdit#removeRoleAccess(String) */ public void removeRoleAccess(String roleId) throws InconsistentException, PermissionException { if (roleId == null || roleId.isEmpty()) { throw new InconsistentException("BasicGroupAwareEdit#removeRoleAccess - Must specify a role to remove for content " + this.getReference()); } if (isRoleView(this.m_id, roleId)) { try { setRoleView(this.m_id, roleId, false); } catch (AuthzPermissionException e) { throw new PermissionException(e.getUser(), e.getFunction(), e.getResource()); } this.m_accessUpdated = true; this.m_access = AccessMode.INHERITED; this.m_groups.clear(); } }
throw new InconsistentException(collectionId); throw new InconsistentException(collectionId); throw new InconsistentException(id); throw new InconsistentException(collectionId);
throw new InconsistentException(id + " is contained within " + folder_id);
throw new InconsistentException(collectionId); throw new InconsistentException(collectionId); throw new InconsistentException(id); throw new InconsistentException(collectionId);
throw new InconsistentException("Could not find the collection " + resourceCollection + " while attempting to " + "add the podcast " + filename);
if (containingCollection == null) throw new InconsistentException(id);
if (containingCollection == null) throw new InconsistentException(id);
throw new InconsistentException(id + " is contained within " + folder_id);
if (!members.isEmpty()) throw new InconsistentException(edit.getId());