Matches the file URL with the most specific pattern and caches this information in a map
Sets cache-control and expires headers
@param session
@param requestFile
@param requestPath
194291
private void addCacheControl(HttpAcceptSession session, File requestFile, String requestPath) {
        CacheControlHandler cacheControlHandler = urlCacheControlMap.computeIfAbsent(requestPath, 
                path -> patterns.stream()
                     .filter(patternCacheControl -> PatternMatcherUtils.caseInsensitiveMatch(requestPath, patternCacheControl.getPattern()))
                     .findFirst()
                     .map(patternCacheControl -> new CacheControlHandler(requestFile, patternCacheControl))
                     .orElse(null)
        );

        if (cacheControlHandler != null) {
            addCacheControlHeader(session, requestFile, cacheControlHandler);
        }
    }
1059727
@SuppressWarnings("deprecation")
    String requestImpl(String graphPath, Bundle params, String httpMethod) throws FileNotFoundException,
            MalformedURLException, IOException {
        params.putString("format", "json");
        if (isSessionValid()) {
            params.putString(TOKEN, getAccessToken());
        }
        String url = (graphPath != null) ? GRAPH_BASE_URL + graphPath : RESTSERVER_URL;
        return Util.openUrl(url, httpMethod, params);
    }
201387
func RequestPath(req *http.Request) (value string) {
	ex := getRequestExecution(req)
	return ex.pattern
}
1331903
public static MatchResult doMatch(final String requestURI, final String httpMethod) {
        MatchResult ret;
        final int segs = StringUtils.countMatches(requestURI, "/");
        ContextHandlerMeta contextHandlerMeta;
        String concreteKey = httpMethod + "." + requestURI;
        switch (segs) {
            case 1:
                contextHandlerMeta = ONE_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, ONE_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, ONE_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, ONE_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, ONE_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, ONE_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
            case 2:
                contextHandlerMeta = TWO_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, TWO_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, TWO_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, TWO_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, TWO_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, TWO_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
            case 3:
                contextHandlerMeta = THREE_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, THREE_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, THREE_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, THREE_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, THREE_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, THREE_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
            default:
                contextHandlerMeta = FOUR_MORE_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
        }
    }
83287
public JsonGetterContext getContext(String queryPath) {
        JsonGetterContext context = internalCache.get(queryPath);
        if (context != null) {
            return context;
        }
        context = new JsonGetterContext(queryPath);
        JsonGetterContext previousContextValue = internalCache.putIfAbsent(queryPath, context);
        if (previousContextValue == null) {
            cleanupIfNeccessary(context);
            return context;
        } else {
            return previousContextValue;
        }
    }
331031
private function extractFolder(string $requestPath, string $folder) : string
    {
        if (!empty($folder)) {
            $requestPath = '/' . trim((string) preg_replace('#^/' . $folder . '#msi', '/', $requestPath), '/');
        }
        if ($requestPath === '') {
            $requestPath = '/';
        }
        return $requestPath;
    }
1242449
private function sendCachingHeaders(string $imagePath = ''): void
    {
        $ifModifiedSince = '';
        if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
            $ifModifiedSince = \preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
        }

        $mdate = \gmdate('D, d M Y H:i:s', \filemtime($imagePath)).' GMT';
        if ($ifModifiedSince == $mdate) {
            \header($this->serverProtocol.' 304 Not Modified', true, 304);
            die();
        }

        \header($this->serverProtocol.' 200 OK', true, 200);
        \header('Last-Modified: '.$mdate);

        $maxAge = $this->baseClass->Image->Server->cacheTime;
        $maxAgeHeader = 'Cache-Control: no-transform,public,max-age='.$maxAge;
        if ($maxAge == 0) {
            $maxAgeHeader = 'Cache-Control: max-age=0, no-cache, no-store';
        }

        \header($maxAgeHeader);
        \header('Expires: '.\gmdate('D, d M Y H:i:s', \time() + $maxAge).' GMT');
    }
318726
public void setRequestMap(final Map<String, Object> requestMap) {
		JKThreadLocal.setValue(JKContextConstants.HTTP_REQUEST_MAP, requestMap);
	}
926023
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
    {
        PrintWriter out;
        String  title = "Index of ";
        String dirName = (String)req.getAttribute("com.ibm.servlet.engine.webapp.dir.browsing.path");
        String reqURI = (String)req.getAttribute("com.ibm.servlet.engine.webapp.dir.browsing.uri");

        // PK81387 Start

        //I believe dirName is now the local dir, not the file system path
        File dir = null;
        URL dirURL = null;
        String dirNameFileSystemPath = req.getRealPath(dirName);
        //this is a servlet, we only have access to the ServletContextFacade
        ServletContext context = getServletConfig().getServletContext();   
        boolean fileSystem = false;
        //dirNameFileSystemPath!=null is not a good enough check to determine if you're in a container
        //if we have a container and there have been jsps compiled, it gives you the directory in the workarea
        if (dirNameFileSystemPath!=null) {
            fileSystem = true;
            dirName=dirNameFileSystemPath;
            dir = new File(dirNameFileSystemPath);

            // get path to war directory
            String contextRealPath = context.getRealPath("/");
            
            int idx=dirName.lastIndexOf(contextRealPath);
            
            if (idx!=-1) {
            	// subtract the war directory from teh reqiested directory
            	String matchString=dirName.substring(idx+contextRealPath.length());
            	
            	matchString=matchString.replace(File.separator,"/");
            	
            	// Ensure matchString starts with "/" so WSUtil.resolveURI processes leading "."s
            	if (!matchString.startsWith("/")) {
            	   matchString="/"+matchString;
            	}
            	
            	// remove a trailing "/" so tthat uriCaseCheck does a vlaid check.
            	if (matchString.endsWith("/")) {
            		matchString=matchString.substring(0, matchString.length()-1);
            	}
            	     
            	// checkWEB-INF unless esposeWebInfoOnDispatch is set and we are in a dispatched request
            	boolean checkWEBINF = !WCCustomProperties.EXPOSE_WEB_INF_ON_DISPATCH || (req.getAttribute(WebAppRequestDispatcher.DISPATCH_NESTED_ATTR)==null) ;
            	
            	try {
            		
            		if (!com.ibm.wsspi.webcontainer.util.FileSystem.uriCaseCheck(dir, matchString,checkWEBINF))
            		{
                        resp.sendError(404, nls.getString("File.not.found", "File not found"));
                        return;
            		}	
            	} catch (java.lang.IllegalArgumentException exc) {
            		// Must be traversing back directories
                    resp.sendError(404, nls.getString("File.not.found", "File not found"));
                    return;
            	}
             } else {
                 // Must be traversing back directories
                 //dirNameFileSystemPath was normalized in Liberty, whereas in tWAS it contained the root path followed by whatever was entered
                 resp.sendError(404, nls.getString("File.not.found", "File not found"));
                 return;
             }
        }
        else { //container
            dirURL = context.getResource(dirName);
            if (dirURL == null) {
                resp.sendError(404, nls.getString("File.not.found", "File not found"));
                return;
            }
        }
            // PK81387 End	
            if (!reqURI.endsWith("/"))
                reqURI += '/';
    
            title += reqURI;
    
            // make sure we can access it
            if (fileSystem && !dir.canRead())
                resp.sendError(404, nls.getString("File.not.found", "File not found"));
        // set the content type
		// set the content type as UTF-8 as filenames are encoded in UTF-8
        resp.setContentType("text/html; charset=UTF-8");

        // write the output
        out = resp.getWriter();

        out.println("<HTML><HEAD><TITLE>");
        out.println(title);
        out.println("</TITLE></HEAD><BODY>");
        out.println("<H1 align=\"left\">" + title + "</H1>");
        out.println("<HR size=\"3\"><TABLE cellpadding=\"2\"><TBODY><TR bgcolor=\"#d7ffff\">");

        // output the table headers
        out.println("<TH width=\"250\" nowrap><P align=\"left\">Name</P></TH>");
        out.println("<TH width=\"250\" nowrap><P align=\"left\">Last Modified</P></TH>");
        out.println("<TH width=\"150\" nowrap><P align=\"left\">Size</P></TH>");
        out.println("<TH width=\"300\" nowrap><P align=\"left\">Description</P></TH></TR>");

        // output a row for each file in the directory
        if (fileSystem) {
            fillTableRows(dir, reqURI, out);
        } else {
            fillTableRows(context, dirName, reqURI, out);
        }

        // finish the page
        out.println("</TBODY></TABLE></BODY></HTML>");

        // close it up
        out.close();
    }
1058963
public String calculateActionPathByJspPath(String requestPath) { // only for JSP
        final String lastPathElement = substringLastRear(requestPath, URL_DELIMITER);
        if (!lastPathElement.contains(".")) { // no JSP
            return requestPath;
        }
        // basically JSP here
        final String frontPathElement = substringLastFront(requestPath, URL_DELIMITER);
        final String fileNameNoExt = substringLastFront(lastPathElement, ".");
        final String pathBase = frontPathElement + URL_DELIMITER;
        if (!fileNameNoExt.contains("_")) { // e.g. list.jsp
            return pathBase; // e.g. /member/ (submit name is needed in this case)
        }
        // the file name has package prefix here
        // e.g. /member/member_list.jsp or /member/list/member_purchase_list.jsp
        final List<String> wordList = splitList(fileNameNoExt, "_"); // e.g. [member, list] or [member, purchase, list]
        if (wordList.size() < 2) { // no way (just in case)
            return pathBase;
        }
        final String firstHit = resolveJspActionPath(requestPath, frontPathElement, pathBase, wordList);
        if (firstHit != null) {
            return firstHit; // e.g. /member/list/ (from /member/member_list.jsp)
        }
        final List<String> retryList = prepareHtmlRetryWordList(requestPath, wordList);
        if (retryList != null && !retryList.isEmpty()) { // e.g. [member, list] (from sp_member_list.jsp)
            final String retryHit = resolveJspActionPath(requestPath, frontPathElement, pathBase, retryList);
            if (retryHit != null) {
                return retryHit; // e.g. /member/list/ (from /member/sp_member_list.jsp)
            }
        }
        // e.g. /member/purchase_list.jsp
        return pathBase; // e.g. /member/ (submit name is needed in this case)
    }
971598
@Override
    public void writeFile(HttpAcceptSession httpSession) throws IOException {
        CharsetEncoder utf8Encoder = UTF_8.newEncoder();

        ResourceAddress localAddress = httpSession.getLocalAddress();
        URI requestURI = localAddress.getResource();
        String requestAuthority = requestURI.getAuthority();

        ConcurrentMap<String, CachedResult> cacheByAuthority = cacheByAuthorityRef.get();
        CachedResult cache = cacheByAuthority.get(requestAuthority);
        if (cache != null) {
            cache.writeFile(httpSession);
            return;
        }

        GatewayHttpOriginSecurity gatewayHttpOriginSecurity = localAddress.getOption(GATEWAY_ORIGIN_SECURITY);

        List<Map<String, Map<String, CrossSiteConstraintContext>>> listOfAcceptConstraintsByURI = gatewayHttpOriginSecurity
                .getAuthorityToSetOfAcceptConstraintsByURI();

        Integer minimumMaximumAge = null;
        IoBufferAllocatorEx<?> bufferAllocator = httpSession.getBufferAllocator();
        IoBufferEx buf = bufferAllocator.wrap(ByteBuffer.allocate(10240), FLAG_SHARED).setAutoExpander(bufferAllocator);

        buf.putString("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", utf8Encoder);
        buf.putString("<access-policy>\n", utf8Encoder);
        buf.putString("<cross-domain-access>\n", utf8Encoder);

        boolean createdPolicy = false;

        HashSet<String> alreadyVisited = new HashSet<>();
        // for all the services
        for (Map<String, Map<String, CrossSiteConstraintContext>> servicesAcceptsToCrossSiteConstraints : listOfAcceptConstraintsByURI) {
            // for each accept on the service
            for (Entry<String, Map<String, CrossSiteConstraintContext>> acceptToConstraints : servicesAcceptsToCrossSiteConstraints
                    .entrySet()) {
                String acceptURI = acceptToConstraints.getKey();
                // if the accept authority matches the request athority
                if (URIUtils.getAuthority(acceptURI).equals(requestAuthority)) {
                    // for each cross site constraint on the accept
                    for (Entry<String, CrossSiteConstraintContext> urlToConstraint : acceptToConstraints
                            .getValue().entrySet()) {
                        CrossSiteConstraintContext constraint = urlToConstraint.getValue();
                        String urlOfConstraint = urlToConstraint.getKey();
                        // limit to purely cross-origin constraints, excluding same-origin constraints
                        // because Silverlight does not fetch or enforce clientaccesspolicy.xml for same-origin HTTP
                        // requests
                        if (!urlOfConstraint.equals(requestURI.toString())) {

                            Integer maximumAge = constraint.getMaximumAge();

                            if (maximumAge != null) {
                                if (minimumMaximumAge == null) {
                                    minimumMaximumAge = maximumAge;
                                } else {
                                    minimumMaximumAge = Math.min(maximumAge, minimumMaximumAge);
                                }
                            }

                            String acceptURIPath = URIUtils.getPath(acceptURI);
                            String sourceOrigin = constraint.getAllowOrigin();
                            String allowHeaders = constraint.getAllowHeaders();
                            String allowOrigin = constraint.getAllowOrigin();
                            String allowMethods = constraint.getAllowMethods();
                            String idString = String.format("%s%s%s%s%s", sourceOrigin, allowHeaders, allowOrigin,
                                    allowMethods, acceptURIPath);

                            // We can get multiple identical definitions due to the Map<URI <Map<String,
                            // DefaultCrossSiteConstraintContext>>>
                            // where we have identical maps on the inside
                            if (!alreadyVisited.contains(idString)) {
                                alreadyVisited.add(idString);

                                createdPolicy = true;
                                buf.putString("<policy>\n", utf8Encoder);

                                // Adding all the relevant headers that are submitted,
                                // by the (silverlight) client!
                                buf.putString("<allow-from http-request-headers=\"", utf8Encoder);

                                // applying the Authoization header:
                                buf.putString(HEADER_AUTHORIZATION + ",", utf8Encoder);

                                // 'X-WebSocket-Extensions' header, which is used to issue
                                // (Kaazing) WebSocket extensions
                                buf.putString(HEADER_WEBSOCKET_EXTENSIONS + ",", utf8Encoder);

                                // 'X-WebSocket-Version' header is used to identify the underlying version of the
                                // (websocket)
                                // protocol;
                                // For our emulation strategy the value looks like "wseb-1.0"
                                buf.putString(HEADER_WEBSOCKET_VERSION + ",", utf8Encoder);

                                // X-Origin header:
                                buf.putString(HEADER_X_ORIGIN + ",", utf8Encoder);

                                // X-Accept-Commands
                                buf.putString(HEADER_X_ACCEPT_COMMANDS + ",", utf8Encoder);

                                // X-Sequence-No
                                buf.putString(HEADER_X_SEQUENCE_NO + ",", utf8Encoder);

                                // original header:
                                URI sourceOriginURI = ("*".equals(sourceOrigin)) ? NULL_ORIGIN : URI.create(URLEncoder
                                        .encode(sourceOrigin, "UTF-8"));
                                String originHeader = format("X-Origin-%s", sourceOriginURI.toASCIIString());
                                buf.putString(originHeader, utf8Encoder);

                                if (allowHeaders != null) {
                                    buf.putString("," + allowHeaders, utf8Encoder);
                                }
                                buf.putString("\">\n", utf8Encoder);

                                if ("*".equals(allowOrigin)) {
                                    buf.putString("<domain uri=\"http://*\"/>\n", utf8Encoder);
                                    buf.putString("<domain uri=\"https://*\"/>\n", utf8Encoder);
                                    buf.putString("<domain uri=\"file:///\"/>\n", utf8Encoder);
                                } else {
                                    buf.putString("<domain uri=\"" + allowOrigin + "\"/>\n", utf8Encoder);
                                }
                                buf.putString("</allow-from>\n", utf8Encoder);

                                buf.putString("<grant-to>\n", utf8Encoder);
                                if (allowMethods != null) {
                                    String[] allowedMethods = allowMethods.toLowerCase().split(",");
                                    for (String allowedMethod : allowedMethods) {
                                        buf.putString("<resource path=\"/;" + allowedMethod, utf8Encoder);
                                        buf.putString(acceptURIPath, utf8Encoder);
                                        buf.putString("\" include-subpaths=\"true\"/>\n", utf8Encoder);
                                    }
                                }
                                buf.putString("</grant-to>\n", utf8Encoder);
                                buf.putString("</policy>\n", utf8Encoder);
                            }

                        }
                    }
                }
            }
        }

        buf.putString("</cross-domain-access>\n", utf8Encoder);
        buf.putString("\n", utf8Encoder);
        buf.flip();

        if (createdPolicy) {
            if (minimumMaximumAge != null) {
                httpSession.setWriteHeader(HEADER_MAX_AGE, valueOf(minimumMaximumAge));
            }
            httpSession.setWriteHeader(HEADER_CONTENT_LENGTH, valueOf(buf.remaining()));

            CachedResult candidateResult = new ValidResult(minimumMaximumAge, buf);
            CachedResult result = cacheByAuthority.putIfAbsent(requestAuthority, candidateResult);
            if (result == null) {
                result = candidateResult;
            }
            result.writeFile(httpSession);
        } else {
            cacheByAuthority.put(requestAuthority, new InvalidResult());
            httpSession.setStatus(HttpStatus.CLIENT_NOT_FOUND);
            httpSession.close(true);
        }
    }
365103
@Override
    @Path("/{requestId}")
    @ApiOperation(value="Retrieve a request or a page of requests according to specified filters",
        notes="If requestId is not present, returns all matching requests.",
        response=Request.class, responseContainer="List")
    public JSONObject get(String path, Map<String,String> headers)
    throws ServiceException, JSONException {
        RequestServices requestServices = ServiceLocator.getRequestServices();
        try {
            Query query = getQuery(path, headers);
            String segOne = getSegment(path, 1);
            if (segOne != null) {
                if (segOne.equals("tops")) {
                    return getTops(query).getJson();
                }
                else if (segOne.equals("breakdown")) {
                    return getBreakdown(query).getJson();
                }
                else if (segOne.equals("paths")) {
                    return getPaths(query).getJson();
                }
                else if (segOne.equals("insights")) {
                    JsonList<Insight> jsonList = getInsights(query);
                    JSONObject json = jsonList.getJson();
                    String trend = query.getFilter("trend");
                    if ("completionTime".equals(trend)) {
                        List<Timepoint> timepoints = requestServices.getRequestTrend(query);
                        json.put("trend", new JsonList<>(timepoints, "trend").getJson().getJSONArray("trend"));
                    }
                    return json;
                }
                else {
                    try {
                        if (query.getBooleanFilter("master")) {
                            String masterRequestId = segOne;
                            if (query.getBooleanFilter("response")) {
                                Request masterRequest = requestServices.getMasterRequestResponse(masterRequestId);
                                if (masterRequest == null)
                                    throw new ServiceException(ServiceException.NOT_FOUND, "Master request not found: " + masterRequestId);
                                return masterRequest.getJson();
                            }
                            else {
                                Request masterRequest = requestServices.getMasterRequest(masterRequestId);
                                if (masterRequest == null)
                                    throw new ServiceException(ServiceException.NOT_FOUND, "Master request not found: " + masterRequestId);
                                return masterRequest.getJson();
                            }
                        }
                        else {
                            Long requestId = Long.valueOf(segOne);
                            if (query.getBooleanFilter("request") && query.getBooleanFilter("response")) {
                                Request request = requestServices.getRequestAndResponse(requestId);
                                if (request == null)
                                    throw new ServiceException(ServiceException.NOT_FOUND, "Request not found: " + requestId);
                                return request.getJson();
                            }
                            else if (query.getBooleanFilter("response")) {
                                Request request = requestServices.getRequestResponse(requestId);
                                if (request == null)
                                    throw new ServiceException(ServiceException.NOT_FOUND, "Request not found: " + requestId);
                                return request.getJson();
                            }
                            else {
                                Request request = requestServices.getRequest(requestId);
                                if (request == null)
                                    throw new ServiceException(ServiceException.NOT_FOUND, "Request not found: " + requestId);
                                return request.getJson();
                            }
                        }
                    }
                    catch (NumberFormatException ex) {
                        throw new ServiceException(ServiceException.BAD_REQUEST, "Bad requestId: " + segOne);
                    }
                }
            }
            else {
                if (query.getLongFilter("ownerId") >= 0L) {
                    RequestList reqList = requestServices.getRequests(query);
                    if (!reqList.getItems().isEmpty())
                        return requestServices.getRequestAndResponse(reqList.getItems().get(0).getId()).getJson();
                    else
                        throw new ServiceException(ServiceException.NOT_FOUND, "Request not found for ownerId: " + query.getLongFilter("ownerId"));
                }
                else
                    return requestServices.getRequests(query).getJson();
            }
        }
        catch (ServiceException ex) {
            throw ex;
        }
        catch (Exception ex) {
            throw new ServiceException(ServiceException.INTERNAL_ERROR, ex.getMessage(), ex);
        }
    }
1144378
protected void setRequestUrl(MockServletRequest request,
			Map<String, String> variantMap, String path, JawrConfig config) {

		String domainURL = JawrConstant.HTTP_URL_PREFIX + DEFAULT_WEBAPP_URL;

		if (JawrConstant.SSL.equals(variantMap
				.get(JawrConstant.CONNECTION_TYPE_VARIANT_TYPE))) {
			// Use the contextPathSslOverride property if it's an absolute URL
			if (StringUtils.isNotEmpty(config.getContextPathSslOverride())
					&& config.getContextPathSslOverride().startsWith(
							JawrConstant.HTTPS_URL_PREFIX)) {
				domainURL = config.getContextPathSslOverride();
			} else {
				domainURL = JawrConstant.HTTPS_URL_PREFIX + DEFAULT_WEBAPP_URL;
			}
		} else {
			// Use the contextPathOverride property if it's an absolute URL
			if (StringUtils.isNotEmpty(config.getContextPathOverride())
					&& config.getContextPathOverride().startsWith(
							JawrConstant.HTTP_URL_PREFIX)) {
				domainURL = config.getContextPathOverride();
			} else {
				domainURL = JawrConstant.HTTP_URL_PREFIX + DEFAULT_WEBAPP_URL;
			}
		}

		request.setRequestUrl(PathNormalizer.joinDomainToPath(domainURL, path));
	}
252730
public boolean shouldNotCache(String requestUri) {
		String uri = requestUri.toLowerCase();
		return checkContains(uri, noCacheIdentifiers) || checkSuffixes(uri, noCacheSuffixes);
	}
1268613
public Collection getUploadFileID(HttpServletRequest request) {
    Debug.logVerbose("[JdonFramework]--> enter cache filter ", module);
    Collection uploadIDList = null;
    try {
      uploadIDList = imageFilter.getUploadFileID(request);
    } catch (Exception ex) {
      Debug.logError("[JdonFramework] not found the upload files in session", module);
    }
    return uploadIDList;

  }
937522
public boolean matches(HttpMethod httpMethod, String requestUri) {
        if (this.httpMethod == httpMethod) {
            return matches(requestUri);
        }
        return false;
    }
222846
void _prepareResponseDataOnlyOnce(HttpServletRequest req) {
        if (req.getAttribute(KEY_FILE) == null) {
            
            String pathInfo    = req.getPathInfo();
            
            if (pathInfo == null)
                pathInfo = "";
            
            String fileSeparator = System.getProperty("file.separator");
            String filePath      = pathInfo.replaceAll(Pattern.quote("/"), fileSeparator);
            String mappedDirPath = getMappedDirPath();

            File file = new File(mappedDirPath, filePath);

            boolean isDirectory = file.isDirectory();
            req.setAttribute(KEY_IS_DIR,        isDirectory);
            
            if (isDirectory)
                file = new File(mappedDirPath, getIndexFilename());

            req.setAttribute(KEY_FILE,          file);
            req.setAttribute(KEY_MIME,          __getMimeType(file));
            req.setAttribute(KEY_LAST_MODIFIED, file.exists() ? file.lastModified() : 0);
        }
    }