public final class ServerTools extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addMime(String ext,
String mime) |
static File |
findConfigFileByName(javax.servlet.ServletContext ctx,
String basename)
Tries to find the named config file.
|
static void |
generateExpiryHeader(javax.servlet.http.HttpServletResponse res,
int exp) |
static void |
generateNoCache(javax.servlet.http.HttpServletResponse response)
Sends headers that are needed to prevent the browser or any proxy in between from caching
the page's contents.
|
static String |
getExtMimeType(String ext)
Returns the mime type of a file by searching the file extension in the
MIME table.
|
static int |
getInt(javax.servlet.http.HttpServletRequest req,
String name) |
static int |
getInt(javax.servlet.http.HttpServletRequest req,
String name,
int dflt) |
static long |
getLong(javax.servlet.http.HttpServletRequest req,
String name)
Gets a 'long' parameter from the request.
|
static String |
getMimeExtension(String mimetype) |
static Properties |
getMimeMap() |
static String |
getMimeString(String mime)
This gets called with a MIME type string.
|
static String |
getMimeType(String fn)
Returns the mime type of a file by searching the file extension in the
MIME table.
|
static String |
getMyHostname() |
static String |
getUniqueString()
Returns an unique string every time it gets called.
|
static void |
initMimeMap()
Load all MIME types.
|
static void |
loadMimeMap(File fn)
Load all MIME types.
|
static String |
makeTimeString() |
public static File findConfigFileByName(javax.servlet.ServletContext ctx, String basename) throws Exception
ctx - basename - Exceptionpublic static String getMyHostname()
public static String getMimeString(String mime)
mime - public static String getExtMimeType(String ext)
public static String getMimeType(String fn)
public static void initMimeMap()
public static void loadMimeMap(File fn) throws Exception
Exceptionpublic static Properties getMimeMap()
public static final String makeTimeString()
public static String getUniqueString()
public static void generateExpiryHeader(javax.servlet.http.HttpServletResponse res,
int exp)
public static void generateNoCache(javax.servlet.http.HttpServletResponse response)
res - public static long getLong(javax.servlet.http.HttpServletRequest req,
String name)
throws javax.servlet.ServletException
req - name - javax.servlet.ServletExceptionpublic static int getInt(javax.servlet.http.HttpServletRequest req,
String name)
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic static int getInt(javax.servlet.http.HttpServletRequest req,
String name,
int dflt)
throws javax.servlet.ServletException
javax.servlet.ServletExceptionCopyright © 2017 etc.to. All rights reserved.