public synchronized Map<String, Object[]> getParameterMap() { if (parameterMap == null) { // Two conditions: file upload ("multipart/form-data") or not if (getContentType() != null && getContentType().startsWith("multipart/form-data")) { // Special handling for multipart/form-data // Decode the multipart data parameterMap = Multipart.getParameterMapMultipart( pipelineContext, request, ServletExternalContext.DEFAULT_FORM_CHARSET_DEFAULT); } else if (portletRequest instanceof ResourceRequest) { // We encoded query parameters directly into the resource id in this case final String queryString = NetUtils.getQueryString(((ResourceRequest) portletRequest).getResourceID()); if (queryString != null) parameterMap = Collections.unmodifiableMap( StringConversions.stringArrayMapToObjectArrayMap( NetUtils.decodeQueryString(queryString, false))); else parameterMap = Collections.emptyMap(); } else { // Not a resource request, so just use native request parameters parameterMap = new HashMap<String, Object[]>(portletRequest.getParameterMap()); parameterMap.remove(WSRPURLRewriter.PathParameterName()); parameterMap = Collections.unmodifiableMap(parameterMap); } } return parameterMap; }
public String getPathInfo() { // Use the resource id if we are a ResourceRequest // In that case, remove the query string part of the resource id, that's handled by // getParameterMap() String result = (portletRequest instanceof ResourceRequest) ? NetUtils.removeQueryString(((ResourceRequest) portletRequest).getResourceID()) : portletRequest.getParameter(WSRPURLRewriter.PathParameterName()); if (result == null) result = ""; return (result.startsWith("/")) ? result : "/" + result; }
public void setContentType(String contentType) { this.contentType = NetUtils.getContentTypeMediaType(contentType); }