Defined enum with all http methods
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/507e338a Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/507e338a Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/507e338a Branch: refs/heads/feature/http-interceptor Commit: 507e338a10b9c0b9f62233c3e9d24ca9436940be Parents: 9519cd1 Author: Lukasz Lenart <[email protected]> Authored: Sat Apr 19 17:46:59 2014 +0200 Committer: Lukasz Lenart <[email protected]> Committed: Sat Apr 19 17:46:59 2014 +0200 ---------------------------------------------------------------------- .../interceptor/httpmethod/HttpMethod.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/507e338a/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethod.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethod.java b/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethod.java new file mode 100644 index 0000000..30f4ea3 --- /dev/null +++ b/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethod.java @@ -0,0 +1,19 @@ +package org.apache.struts2.interceptor.httpmethod; + +public enum HttpMethod { + + GET, + HEAD, + POST, + PUT, + DELETE, + TRACE, + OPTIONS, + CONNECT, + PATCH; + + public static HttpMethod parse(String httpRequestMethod) { + return valueOf(httpRequestMethod.toUpperCase()); + } + +}
