|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.openrdf.util.http.HttpServerUtil
Utility methods for HTTP servers/servlets.
| Constructor Summary | |
HttpServerUtil()
|
|
| Method Summary | |
static boolean |
acceptsGZIPEncoding(HttpServletRequest request)
Checks whether the sender of the supplied request can handle gzip-encoded data. |
static byte[] |
getBinaryParameter(Map fileItemMap,
String paramName)
Gets the binary value of a request parameter from a Map of FileItem objects, as returned by parseMultipartFormRequest(). |
static String |
getParameter(HttpServletRequest request,
String paramName)
Gets the trimmed value of a request parameter as a String. |
static String |
getParameter(HttpServletRequest request,
String paramName,
String defaultValue)
Gets the trimmed value of a request parameter as a String. |
static String |
getParameter(Map fileItemMap,
String paramName)
Gets the trimmed value of a request parameter from a Map of FileItem objects, as returned by parseMultipartFormRequest(). |
static String |
getParameter(Map fileItemMap,
String paramName,
String defaultValue)
Gets the trimmed value of a request parameter from a Map of FileItem objects, as returned by parseMultipartFormRequest(). |
static InputStream |
getStreamParameter(Map fileItemMap,
String paramName)
Gets the value of a request parameter as an InputStream from a Map of FileItem objects, as returned by parseMultipartFormRequest(). |
static boolean |
isMultipartFormRequest(HttpServletRequest request)
Checks whether the supplied request is a multipart/form-data POST request. |
static OutputStream |
openGZIPOutputStream(HttpServletResponse response)
Opens an gzip-encoded output stream for the specified response. |
static Map |
parseMultipartFormRequest(HttpServletRequest request)
Parses a multipart/form-data POST request and returns its parameters as set of FileItems, mapped using their field name. |
static void |
setNoCacheHeaders(HttpServletResponse response)
Sets headers on the supplied response that prevent all kinds of browsers to cache it. |
static void |
setTmpDir(File tmpDir)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HttpServerUtil()
| Method Detail |
public static void setTmpDir(File tmpDir)
public static boolean isMultipartFormRequest(HttpServletRequest request)
public static String getParameter(HttpServletRequest request,
String paramName)
request - The request object to get the parameter from.paramName - The name of the parameter.
public static String getParameter(HttpServletRequest request,
String paramName,
String defaultValue)
request - The request object to get the parameter from.paramName - The name of the parameter.defaultValue - The value that should be returned when the specified
parameter did not have a value.
public static Map parseMultipartFormRequest(HttpServletRequest request)
throws IOException
request - The request.
IOException - If the request could not be read/parsed.
public static String getParameter(Map fileItemMap,
String paramName)
fileItemMap - A Map of FileItem objects, mapped using their field
name (Strings).paramName - The name of the parameter.
public static String getParameter(Map fileItemMap,
String paramName,
String defaultValue)
fileItemMap - A Map of FileItem objects, mapped using their field
name (Strings).paramName - The name of the parameter.defaultValue - The value that should be returned when the specified
parameter did not have a value.
public static byte[] getBinaryParameter(Map fileItemMap,
String paramName)
fileItemMap - A Map of FileItem objects, mapped using their field
name (Strings).paramName - The name of the parameter.
public static InputStream getStreamParameter(Map fileItemMap,
String paramName)
throws IOException
fileItemMap - A Map of FileItem objects, mapped using their field
name (Strings).paramName - The name of the parameter.
IOExceptionpublic static void setNoCacheHeaders(HttpServletResponse response)
public static boolean acceptsGZIPEncoding(HttpServletRequest request)
request - A HTTP request
public static OutputStream openGZIPOutputStream(HttpServletResponse response)
throws IOException
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||