Returns the text to be included at the beginning of the layer if module name id
encoding is enabled.

@param request
the http request object
@return the string to include at the beginning of the layer
975857
protected String moduleNameIdEncodingBeginLayer(HttpServletRequest request) {
		StringBuffer sb = new StringBuffer();
		if (request.getParameter(AbstractHttpTransport.SCRIPTS_REQPARAM) != null) {
			// This is a request for a bootstrap layer with non-AMD script modules.
			// Define the deps variable in global scope in case it's needed by
			// the script modules.
			sb.append("var " + EXPDEPS_VARNAME + ";");  //$NON-NLS-1$//$NON-NLS-2$
		}
		return sb.toString();
	}
278081
protected String getDescription(HttpServletRequest request) {
		String pathInfo = (request.getPathInfo() != null) ? request.getPathInfo() : "";
		return "[" + request.getServletPath() + pathInfo + "]";
	}
856170
public static String extractResourcePath(HttpServletRequest request) {
		if (request == null || request.getRequestURI().length() <= 3) {
			return "";
		}
		// get request path, strip first slash '/'
		String uri = request.getRequestURI().substring(1);
		// skip to the end of API version prefix '/v1/'
		int start = uri.indexOf('/');

		if (start >= 0 && start + 1 < uri.length()) {
			return uri.substring(start + 1);
		} else {
			return "";
		}
	}
493662
public static String repositoryUrl( HttpServletRequest request ) {
        String requestURL = request.getRequestURL().toString();
        int delimiterSegmentIdx = requestURL.length();
        for (String methodName : ALL_METHODS) {
            if (requestURL.indexOf(methodName) != -1) {
                delimiterSegmentIdx = requestURL.indexOf(methodName);
                break;
            }
        }
        return requestURL.substring(0, delimiterSegmentIdx);
    }
940599
public static Tag uri(HttpRequest request) {
		return Tag.of("uri", ensureLeadingSlash(stripUri(request.getURI().toString())));
	}
789277
protected String buildQueryString(Request request)
    {
        MultiMap resolvedParameters = null;
        if(parameterFactory != null)
        {
            resolvedParameters = parameterFactory.getParameters();
        }

        if(hasEntries(resolvedParameters))
            resolvedParameters = resolvedParameters.merge(request.getParameters());
        else
            resolvedParameters = request.getParameters();

        if(authorizationFactory != null)
        {
            MultiMap authEntries = authorizationFactory.getParameters();
            if(hasEntries(authEntries))
                resolvedParameters = resolvedParameters.merge(authEntries);
        }


        int ct = 0;
        StringBuilder sb = new StringBuilder(512);
        for (Map.Entry<String, List<String>> entry : resolvedParameters.entries())
        {
            for (String value : entry.getValue())
            {
                if(ct++ > 0)
                    sb.append("&");
                sb.append(encode(entry.getKey())).append("=").append(encode(value));
            }
        }

        return sb.toString();
    }
9590
public static String getHeader(HttpServletRequest request, String header) {

		// noting to search in or nothing to be found
		if (request == null || StringUtils.isNullOrEmptyTrimmed(header)) {
			return null;
		}

		return request.getHeader(header);
	}
129526
public static String getCookieUsername(HttpServletRequest request) {
		String username = CookieUtil.getCookie("username", request);
		try {
			username = URLDecoder.decode(username, "UTF-8");
		}
		catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
		return username;
	}
600163
@SuppressWarnings("unused")
	public static <T> String getRequestPayload(Request<T> request) {
		Class<?> referenceClazz = request.getClass();
		List<Field> fields = ClassUtil.getAnnotatedFields(referenceClazz, Body.class);
		List<String> objects = new LinkedList<String>();
		for (Field field : fields) {
			Body body = field.getAnnotation(Body.class);

			String asString = ClassUtil.getValueOf(field, request, referenceClazz, String.class);
			return (asString != null ? asString : "");
			// what if there are more bodies?!
		}
		return EMPTY;
	}
1041913
public static String getRequestURI(final HttpServletRequest request) {
		return (String) request.getSession(true).getAttribute(STORE_URI_KEY);
	}
117029
protected boolean includeRequest(HttpServletRequest request) {
        if (ArrayUtils.isNotEmpty(urlsToInclude)) {
            for (String pathPattern : urlsToInclude) {
                if (pathMatcher.match(pathPattern, HttpUtils.getRequestUriWithoutContextPath(request))) {
                    return true;
                }
            }
        }

        return false;
    }
61982
private static String getRequestBody(final HttpServletRequest request) {
        val body = readRequestBodyIfAny(request);
        if (!StringUtils.hasText(body)) {
            LOGGER.trace("Looking at the request attribute [{}] to locate SAML request body", SamlProtocolConstants.PARAMETER_SAML_REQUEST);
            return (String) request.getAttribute(SamlProtocolConstants.PARAMETER_SAML_REQUEST);
        }
        return body;
    }
633090
protected String getMethod(HttpServletRequest request) {
        String uri = request.getRequestURI();
        String q = uri.substring((request.getContextPath()+request.getServletPath()).length()+1);
        int i = q.indexOf(".");
        String method = null;
        if(i>0){
            method = q.substring(i+1);
        }
        return method;
    }
663530
protected PresentationState getPresentationState(HttpServletRequest request) {
    String attrName = getPresentationAttrName();

    if ((attrName == null) ||
         (attrName.equals("NONE"))) {
      return null;
    }

    /* First try the request */

    Object o = request.getAttribute(attrName);

    if (o == null) {
      HttpSession sess = request.getSession(false);

      if (sess == null) {
        return null;
      }

      o = sess.getAttribute(attrName);
    }

    if (o == null) {
      return null;
    }

    PresentationState ps = (PresentationState)o;

    if (debug()) {
      ps.debugDump("ConfiguredXSLTFilter");
    }

    return ps;
  }
861968
public static String getServletPath(HttpServletRequest request) {
    String servletPath = request.getServletPath();
    if (Strings.isNotEmpty(servletPath)) {
      return servletPath;
    } else {
      String uri = request.getRequestURI();
      if (uri.length() == 1) return "";
      // process context
      String context = request.getContextPath();
      int length = context.length();
      if (length > 2) {
        if ('/' == context.charAt(length - 1)) context = context.substring(0, length - 1);
        return servletPath = uri.substring(context.length());
      } else {
        return uri;
      }
    }
  }
831090
protected String getDynamicLoaderExtensionJavaScript(HttpServletRequest request) {
		final String sourceMethod = "getDynamicLoaderExtensionJavaScript"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod);
		}
		StringBuffer sb = new StringBuffer();
		for (String contribution : getExtensionContributions()) {
			sb.append(contribution).append("\r\n"); //$NON-NLS-1$
		}
		String cacheBust = AggregatorUtil.getCacheBust(getAggregator());
		if (cacheBust != null && cacheBust.length() > 0) {
			sb.append("if (!require.combo.cacheBust){require.combo.cacheBust = '") //$NON-NLS-1$
			.append(cacheBust).append("';}\r\n"); //$NON-NLS-1$
		}
		contributeBootLayerDeps(sb, request);
		if (moduleIdListHash != null) {
			sb.append("require.combo.reg(null, ["); //$NON-NLS-1$
			for (int i = 0; i < moduleIdListHash.length; i++) {
				sb.append(i == 0 ? "" : ", ").append(((int)moduleIdListHash[i])&0xFF); //$NON-NLS-1$ //$NON-NLS-2$
			}
			sb.append("]);\r\n"); //$NON-NLS-1$
		}
		sb.append(clientRegisterSyntheticModules());
		if (isTraceLogging) {
			log.exiting(sourceClass, sourceMethod, sb.toString());
		}
		return sb.toString();
	}
357364
public static HttpServletRequest getEncodingRequest(
            HttpServletRequest request)
            throws UnsupportedEncodingException {
        String method = request.getMethod();
        if (method.equalsIgnoreCase("post")) {
            return new EncodingPostRequest(request);
        } else if (method.equalsIgnoreCase("get")) {
            return new EncodingGetRequest(request);
        }
        return request;
    }