Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
ed7c473f
Commit
ed7c473f
authored
Oct 21, 2015
by
Matija Obreza
Browse files
REST API: Refuse GENUS with spaces and "sp."
parent
b5568d5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/BatchRESTServiceImpl.java
View file @
ed7c473f
...
...
@@ -106,6 +106,10 @@ public class BatchRESTServiceImpl implements BatchRESTService {
current
.
setSubtaxa
(
StringUtils
.
defaultIfBlank
(
stringIfProvided
(
accnJson
.
get
(
Api1Constants
.
Accession
.
SUBTAXA
),
current
.
getSubtaxa
()),
""
));
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
())
{
LOG
.
debug
(
"Ensuring "
+
current
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment