mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Remove unused request parameter extractor
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130672143
This commit is contained in:
parent
f10a7d8fb0
commit
5ff8b9377c
2 changed files with 0 additions and 34 deletions
|
@ -58,19 +58,6 @@ public final class RequestParameters {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns first GET or POST parameter associated with {@code name}.
|
||||
*
|
||||
* @throws BadRequestException if request parameter is absent (but not if empty)
|
||||
*/
|
||||
public static String extractRequiredMaybeEmptyParameter(HttpServletRequest req, String name) {
|
||||
String result = req.getParameter(name);
|
||||
if (result == null) {
|
||||
throw new BadRequestException("Missing parameter: " + name);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Returns the first GET or POST parameter associated with {@code name}. */
|
||||
public static Optional<String> extractOptionalParameter(HttpServletRequest req, String name) {
|
||||
return Optional.fromNullable(emptyToNull(req.getParameter(name)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue