/** * Tests the values of the given repo group to ensure creating the group would be a valid operation, including * ensuring the name is specified and there isn't already an existing group with the same name. * * @param repoGroup group to test * @throws RepoException if the group should not be allowed to be created */ private void validateRepoGroup(RepoGroup repoGroup) throws RepoException { if (repoGroup.getName() == null || repoGroup.getName().trim().equals("")) { throw new RepoException("Repo group name is required"); } RepoGroup existingRepoGroup = getRepoGroupByName(repoGroup.getName()); if (existingRepoGroup != null) { RepoException e = new RepoException("There is already a repo group with the name [" + repoGroup.getName() + "]"); e.setType(RepoException.RepoExceptionType.NAME_ALREADY_EXISTS); throw e; } }