@param request
the request object

@return True if source maps are enabled for this request
486098
public static boolean isSourceMapsEnabled(HttpServletRequest request) {
		IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME);
		IOptions options = aggr.getOptions();
		boolean result = false;
		if (options.isSourceMapsEnabled()) {
			result = TypeUtil.asBoolean(request.getAttribute(IHttpTransport.GENERATESOURCEMAPS_REQATTRNAME));
		}
		return result;
	}
1058997
public String mapRequestPath(HttpServletRequest request) {

        String endpointName = Path.newInstance(request).firstSegment();
        return StringUtils.lowerCase(endpointName);
    }
848045
public static boolean isSaneRequest(HttpServletRequest request) {
        if (request != null && request.getMethod() != null) {
            return true;
        }
        return false;
    }
422615
@SuppressWarnings("null")
  private boolean accepts(SlingHttpServletRequest request) {
    return request.getMethod().equalsIgnoreCase(METHOD_GET)
        && request.getResource() != null
        && StringUtils.equals(request.getResource().getValueMap().get(JCR_PRIMARYTYPE, String.class), NT_FILE);
  }
1065941
public boolean isCompliantWithRequestAccept(Request request) {
        if (producedMediaTypes == null || producedMediaTypes.isEmpty() || request == null
                || request.getHeader(HeaderNames.ACCEPT) == null) {
            return true;
        } else {
            for (MediaType mt : producedMediaTypes) {
                if (request.accepts(mt.toString())) {
                    return true;
                }
            }
            return false;
        }
    }
504756
public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
		return
			Boolean.parseBoolean(servletContext.getInitParameter(ENABLE_INIT_PARAM))
			&& isAllowedAddr(request.getRemoteAddr())
		;
	}
294010
private void addQueryParams(final Request request) {
        if (isoCode != null) {
            request.addQueryParam("IsoCode", isoCode);
        }

        if (continent != null) {
            request.addQueryParam("Continent", continent);
        }

        if (countryCode != null) {
            request.addQueryParam("CountryCode", countryCode);
        }

        if (lowRiskNumbersEnabled != null) {
            request.addQueryParam("LowRiskNumbersEnabled", lowRiskNumbersEnabled.toString());
        }

        if (highRiskSpecialNumbersEnabled != null) {
            request.addQueryParam("HighRiskSpecialNumbersEnabled", highRiskSpecialNumbersEnabled.toString());
        }

        if (highRiskTollfraudNumbersEnabled != null) {
            request.addQueryParam("HighRiskTollfraudNumbersEnabled", highRiskTollfraudNumbersEnabled.toString());
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
361540
public static boolean isMultipart(HttpServletRequest request) {
		if (false == isPostMethod(request)) {
			return false;
		}

		String contentType = request.getContentType();
		if (StrUtil.isBlank(contentType)) {
			return false;
		}
		if (contentType.toLowerCase().startsWith("multipart/")) {
			return true;
		}

		return false;
	}
1120973
public static boolean isJsonRequest(ServletRequest request) {

        HttpServletRequest sr = (HttpServletRequest)request;
        return (sr.getQueryString() != null) && (sr.getQueryString().contains("__json=true"));
    }
627695
public static boolean isHttpPostRequest(HttpServletRequest request) {
        boolean isSane = isSaneRequest(request);
        boolean isPost = isSane && request.getMethod().equals(HttpMethod.POST.toString());
        return isSane && isPost;
    }
1025691
public void filter(ClientRequestContext request) throws IOException
    {
        if(!request.getHeaders().containsKey("X-Api-Key"))
            request.getHeaders().add("X-Api-Key", this.apikey);
    }
1301842
private Map<String, Set<String>> getParameters(HttpServletRequest request) {
        Map<String, String[]> params = request.getParameterMap();

        Map<String, Set<String>> queryParameters = new HashMap<>(params.size());
        for (Map.Entry<String, String[]> entry : params.entrySet()) {
            queryParameters.put(entry.getKey(), new HashSet<>(Arrays.asList(entry.getValue())));
        }
        return queryParameters;
    }
1333762
public static Map<String, String[]> getRequestParameters(final HttpServletRequest request) {
		if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) {
			setupRequestParameters(request);
		}
		return (Map<String, String[]>) request.getAttribute(REQUEST_PARAMETERS_KEY);
	}
723013
public static Map<String, List<StringValue>> getPageParametersMap(final Request request)
	{
		final Map<String, List<StringValue>> map = new HashMap<>();
		addToParameters(request.getRequestParameters(), map);
		addToParameters(request.getQueryParameters(), map);
		addToParameters(request.getPostParameters(), map);
		return map;
	}
1221187
private Collection<RequestMapperBean> initializeRequestMappers(final Request request)
	{
		final Set<RequestMapperBean> mapperBeans = new TreeSet<>(getComparator());
		for (final IRequestMapper requestMapper : this.requestMappers)
		{
			mapperBeans.add(
				new RequestMapperBean(requestMapper, requestMapper.getCompatibilityScore(request)));
		}
		return mapperBeans;
	}
366642
public static final boolean isMultipartContent(HttpServletRequest request) {
		if (!RestConst.POST_METHOD.equalsIgnoreCase(request.getMethod())) {
			return false;
		}
		String contentType = request.getContentType();
		if (contentType == null) {
			return false;
		}
		contentType = contentType.toLowerCase(Locale.ENGLISH);
		if (contentType.startsWith(RestConst.MULTIPART) 
				|| MediaType.APPLICATION_OCTET_STREAM.equals(contentType)) {
			return true;
		}
		return false;
	}
895827
@Override
	protected void setOtherResourceBundles(HttpServletRequest request)
	{
		Locale locale = request.getLocale();

        if (errorBundleName != null)
        {
            ResourceBundle errorBundle = getLocalizationBundleFactory().getErrorMessageBundle(locale);
            Config.set(request, errorBundleName, new LocalizationContext(errorBundle, locale));
            LOGGER.debug("Loaded Stripes error message bundle ", errorBundle, " as ", errorBundleName);
        }

        if (fieldBundleName != null)
        {
            ResourceBundle fieldBundle = getLocalizationBundleFactory().getFormFieldBundle(locale);
            Config.set(request, fieldBundleName, new LocalizationContext(fieldBundle, locale));
            LOGGER.debug("Loaded Stripes field name bundle ", fieldBundle, " as ", fieldBundleName);
        }
	}