Package com.jprofiler.api.agent
Class HttpUtil
- java.lang.Object
-
- com.jprofiler.api.agent.HttpUtil
-
public class HttpUtil extends java.lang.ObjectClass with helper methods for http splitting scripts
-
-
Constructor Summary
Constructors Constructor Description HttpUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetParameter(java.lang.String parameterName, java.lang.String queryString)Returns the value for the first occurrence of a parameter in a query string.static java.util.Map<java.lang.String,java.util.List<java.lang.String>>getParameters(java.lang.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 java.lang.StringgetPathSegments(java.lang.String requestURI, int fromSegment, int toSegment, boolean replaceNumericIds)Returns the specified part of the request URI
-
-
-
Method Detail
-
getPathSegments
public static java.lang.String getPathSegments(java.lang.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- iftruesegments that only contain numbers are replaced with<id>- Returns:
- the specified part of the request URI
-
getParameter
public static java.lang.String getParameter(java.lang.String parameterName, java.lang.String queryString)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
nullif the parameter was not found
-
getParameters
public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameters(java.lang.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.- Parameters:
queryString- the query string- Returns:
- the map from parameter names to lists of parameter values
-
-