Class HttpUtils
java.lang.Object
org.apache.juneau.rest.common.utils.HttpUtils
HTTP utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringdetectHttpMethod(Method m, boolean detectMethod, String def) Given a method name, infers the REST method name.static StringdetectHttpPath(Method m, String method) Given a Java method, infers the REST path.
-
Method Details
-
detectHttpMethod
Given a method name, infers the REST method name.- Parameters:
m- The Java method. Must not benull .detectMethod- Whether we should auto-detect the HTTP method name from the Java method name.def- The default HTTP method if not detected. Can benull .- Returns:
- The REST method name, or
def (which can benull ) if not detected.
-
detectHttpPath
Given a Java method, infers the REST path.- Parameters:
m- The Java method. Must not benull .method- The HTTP method name if it's known. Can benull , in which case the path is inferred from Java method naming conventions.- Returns:
- The REST path. Never
null (falls back to'/' + methodName when no convention matches).
-