Java Code Examples for org.mortbay.jetty.handler.ContextHandler#SContext
The following examples show how to use
org.mortbay.jetty.handler.ContextHandler#SContext .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpServer.java From hadoop with Apache License 2.0 | 5 votes |
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
Example 2
Source File: HttpServer2.java From hadoop with Apache License 2.0 | 5 votes |
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
Example 3
Source File: HttpServer.java From big-c with Apache License 2.0 | 5 votes |
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
Example 4
Source File: HttpServer2.java From big-c with Apache License 2.0 | 5 votes |
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
Example 5
Source File: HttpServer.java From RDFS with Apache License 2.0 | 5 votes |
/** * Infer the mime type for the response based on the extension of the * request URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }