@Override public Category getCategory(@Nonnull final String categoryName) { if (StringUtils.isBlank(categoryName)) { this.logger.error("The category should not be blank."); throw new WebApplicationException(Response.Status.BAD_REQUEST); } if (!this.vm.hasCategory(categoryName)) { this.logger.error("Could not find specified category: {}", categoryName); throw new WebApplicationException(Response.Status.NOT_FOUND); } return this.objectFactory.createLinkedCategoryRepresentation(categoryName, getCategoryLinks(), this::getVocabulariesForCategory); }
if (!this.vm.hasCategory(category)) { this.logger.error("The requested vocabulary category [{}] does not exist.", category); throw new WebApplicationException(Response.Status.NOT_FOUND);