/** * Return the request URI for this request. */ public String getRequestURI() { return request.requestURI().toString(); }
/** * Get the request URI associated with this processor. */ public String getRequestURI() { return request.requestURI().toString(); }
/** * Return the request URI for this request. */ public String getRequestURI() { return request.requestURI().toString(); }
/** * Get the request URI associated with this processor. */ public String getRequestURI() { return request.requestURI().toString(); }
public String getCurrentUri() { return req.requestURI().toString(); }
/** * Return the request URI for this request. */ public String getRequestURI() { return request.requestURI().toString(); }
@Override public boolean isApplicationRequest(Request request) { final String uri = request.requestURI().toString(); return mapping.matcher(uri).matches(); }
@Override public String getRequestURI() { return request.requestURI().getString(); }
public String toString() { return "R( " + requestURI().toString() + ")"; }
public String getCurrentUri() { return req.requestURI().toString(); }
public String toString() { return "R( " + requestURI().toString() + ")"; }
public String toString() { return "R( " + requestURI().toString() + ")"; }
public String getCurrentUri() { return req.requestURI().toString(); }
public void service(Request req, final Response res) throws Exception { MessageBytes mb = req.requestURI(); ByteChunk requestURI = mb.getByteChunk(); String uri = req.requestURI().toString(); if (uri.indexOf("..") >= 0) { res.setStatus(404); return; } service(uri, req, res); }
/** * Based on the {@link Request} URI, try to map the file from the rootFolder, and send it synchronously using send file. * @param req the {@link Request} * @param res the {@link Response} * @throws Exception */ public void service(Request req, final Response res) throws Exception { String uri = req.requestURI().toString(); if (uri.contains("..") || !uri.startsWith(resourcesContextPath)) { res.setStatus(404); if (commitErrorResponse) { customizedErrorPage(req, res); } return; } // We map only file that take the form of name.extension if (uri.contains(".")) { uri = uri.substring(resourcesContextPath.length()); } service(uri, req, res); }
public void service(Request req, final Response res) throws Exception { String uri = req.requestURI().toString(); if (uri.indexOf("..") >= 0) { res.setStatus(404); customizedErrorPage(req,res); return; } service(uri, req, res); }
/** * Return <tt>true</tt> if the file is cached. */ protected final FileCacheEntry map(Request request){ FileCacheEntry entry = null; if ( !fileCache.isEmpty() ){ String uri = request.requestURI().toString(); entry = fileCache.get(uri); if (entry != null) { String host = request.serverName().toString(); if (!host.equals(entry.host)) { entry = null; } } recalcCacheStatsIfMonitoring(entry); } else { recalcCacheStatsIfMonitoring(null); } return entry; }
/** * Based on the {@link Request} URI, try to map the file from the * {@link StaticResourcesAdapter#rootFolder}, and send it synchronously using send file. * @param req the {@link Request} * @param res the {@link Response} * @throws java.lang.Exception */ public void service(Request req, final Response res) throws Exception { String uri = req.requestURI().toString(); if (uri.indexOf("..") >= 0) { res.setStatus(404); customizedErrorPage(req,res); return; } service(uri, req, res); }
/** * Extracts the session ID from the request URI. */ protected void parseSessionIdFromRequestURI() { int start, end, sessionIdStart, semicolon, semicolon2; ByteChunk uriBC = request.requestURI().getByteChunk(); start = uriBC.getStart(); end = uriBC.getEnd(); semicolon = uriBC.indexOf(match, 0, match.length(), 0); if (semicolon > 0) { sessionIdStart = start + semicolon; semicolon2 = uriBC.indexOf (';', semicolon + match.length()); uriBC.setEnd(start + semicolon); byte[] buf = uriBC.getBuffer(); if (semicolon2 >= 0) { System.arraycopy(buf, start + semicolon2, buf, start + semicolon, end - start - semicolon2); uriBC.setBytes(buf, start, semicolon + (end - start - semicolon2)); } } }
/** * Intercept the request and decide if we cache the static resource. If the * static resource is already cached, return it. */ public int handle(Request req, int handlerCode) throws IOException{ if (fileCache == null) { return Interceptor.CONTINUE; } if (handlerCode == Interceptor.RESPONSE_PROCEEDED && fileCache.isEnabled()){ String docroot = SelectorThread.getSelector( socketChannel.socket().getLocalAddress(), socketChannel.socket().getLocalPort()).getWebAppRootPath(); String uri = req.requestURI().toString(); fileCache.add(FileCache.DEFAULT_SERVLET_NAME,docroot, uri, req.serverName().toString(), req.getResponse().getMimeHeaders(), false); } else if (handlerCode == Interceptor.REQUEST_LINE_PARSED) { if (fileCache.sendCache(req)){ return Interceptor.BREAK; } } return Interceptor.CONTINUE; }