Commit ed7c473f authored by Matija Obreza's avatar Matija Obreza

REST API: Refuse GENUS with spaces and "sp."

parent b5568d5b
...@@ -106,6 +106,10 @@ public class BatchRESTServiceImpl implements BatchRESTService { ...@@ -106,6 +106,10 @@ public class BatchRESTServiceImpl implements BatchRESTService {
current.setSubtaxa(StringUtils.defaultIfBlank(stringIfProvided(accnJson.get(Api1Constants.Accession.SUBTAXA), current.getSubtaxa()), "")); current.setSubtaxa(StringUtils.defaultIfBlank(stringIfProvided(accnJson.get(Api1Constants.Accession.SUBTAXA), current.getSubtaxa()), ""));
current.setSubtAuthor(StringUtils.defaultIfBlank(stringIfProvided(accnJson.get(Api1Constants.Accession.SUBTAUTHOR), current.getSubtAuthor()), "")); current.setSubtAuthor(StringUtils.defaultIfBlank(stringIfProvided(accnJson.get(Api1Constants.Accession.SUBTAUTHOR), current.getSubtAuthor()), ""));
if (current.getGenus().contains(" ") || current.getGenus().contains("sp.")) {
throw new RESTApiException("GENUS cannot contain spaces or 'sp.'. Offending genus: " + current.getGenus());
}
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Ensuring " + current); LOG.debug("Ensuring " + current);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment