Package com.jprofiler.api.agent
Class HttpUtil
java.lang.Object
com.jprofiler.api.agent.HttpUtil
Class with helper methods for http splitting scripts
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getParameter
(String parameterName, String queryString) Returns the value for the first occurrence of a parameter in a query string.getParameters
(String queryString) Returns a map with the values for all parameters in a query string This method is intended for generic URL splitting scripts, for servlet splitting scripts theservletRequest.getParameterMap(...)
method should be used instead.static String
getPathSegments
(String requestURI, int fromSegment, int toSegment, boolean replaceNumericIds) Returns the specified part of the request URI
-
Constructor Details
-
HttpUtil
public HttpUtil()
-
-
Method Details
-
getPathSegments
public static String getPathSegments(String requestURI, int fromSegment, int toSegment, boolean replaceNumericIds) Returns the specified part of the request URI- Parameters:
requestURI
- the request URI fromjavax.servlet.http.HttpServletRequest.getRequestURI()
fromSegment
- the first segment to be included, the index is one-basedtoSegment
- the last segment to be included, the index is one-basedreplaceNumericIds
- iftrue
segments that only contain numbers are replaced with<id>
- Returns:
- the specified part of the request URI
-
getParameter
Returns the value for the first occurrence of a parameter in a query string. This method is intended for generic URL splitting scripts, for servlet splitting scripts theservletRequest.getParameter(...)
method should be used instead.- Parameters:
parameterName
- the name of the parameterqueryString
- the query string- Returns:
- the value or
null
if the parameter was not found
-
getParameters
Returns a map with the values for all parameters in a query string This method is intended for generic URL splitting scripts, for servlet splitting scripts theservletRequest.getParameterMap(...)
method should be used instead.- Parameters:
queryString
- the query string- Returns:
- the map from parameter names to lists of parameter values
-