com.groiss.servlet
Class FileServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.groiss.servlet.FileServlet
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
public class FileServlet
- extends HttpServlet
This servlet is for sending file to the browser.
- See Also:
- Serialized Form
|
Method Summary |
static void |
addVirtualRoot(String id,
String root)
|
static com.groiss.cache.FileCacheItem |
findFile(Locale l,
String root,
String path)
|
static com.groiss.cache.FileCacheItem |
findFile(Locale l,
String root,
String path,
String starts)
lookup a file in the locale dependent file tree |
static String |
getDocumentRoot()
|
static String |
getMappedImage(String imagePath)
Returns the shiny path for the passed image path. |
static long |
getRequestCount()
|
static String |
getVirtualRoot(String id)
|
static String |
getVirtualRoot(String vroot,
String loc)
|
static HttpServletRequest |
logRequest(HttpServletRequest req,
HttpServletResponse res)
|
static void |
logRequestProcessed(long startTime,
HttpServletRequest req)
|
protected void |
service(HttpServletRequest req,
HttpServletResponse res)
|
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
virtualRoots
protected static final Map<String,String> virtualRoots
roots
protected static final Map<String,String> roots
documentRoot
protected static String documentRoot
cnt
protected static long cnt
expires
protected static long expires
FileServlet
public FileServlet()
service
protected void service(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
- Overrides:
service in class HttpServlet
- Throws:
IOException
ServletException
getVirtualRoot
public static String getVirtualRoot(String id)
getRequestCount
public static long getRequestCount()
getVirtualRoot
public static String getVirtualRoot(String vroot,
String loc)
addVirtualRoot
public static void addVirtualRoot(String id,
String root)
getDocumentRoot
public static String getDocumentRoot()
findFile
public static com.groiss.cache.FileCacheItem findFile(Locale l,
String root,
String path)
throws FileNotFoundException,
IOException
- Throws:
FileNotFoundException
IOException
findFile
public static com.groiss.cache.FileCacheItem findFile(Locale l,
String root,
String path,
String starts)
throws FileNotFoundException,
IOException
- lookup a file in the locale dependent file tree
- Parameters:
l - the locale, can be null for locale independent filesroot - the root of searchpath - the relative path of the resourcestarts - the id of the application, needed for finding the resource to make the language
substitutions
- Throws:
FileNotFoundException
IOException
logRequest
public static HttpServletRequest logRequest(HttpServletRequest req,
HttpServletResponse res)
logRequestProcessed
public static void logRequestProcessed(long startTime,
HttpServletRequest req)
getMappedImage
public static String getMappedImage(String imagePath)
- Returns the shiny path for the passed image path. If no shiny path is available the passed path is returned.
- Parameters:
imagePath - the original path of the image
- Returns:
- the path for the shiny version of the image
@enterprise 8.0.10078 Copyright © 2001-2011 Groiss Informatics GmbH. All Rights Reserved.