public abstract class AbstractFileRequestHandler extends java.lang.Object implements RequestHandler<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
ALLOWED_FILE_NAME |
static int |
HTTP_CACHE_SECONDS |
static java.lang.String |
HTTP_DATE_FORMAT |
static java.lang.String |
HTTP_DATE_GMT_TIMEZONE |
static java.util.regex.Pattern |
INSECURE_URI |
Constructor and Description |
---|
AbstractFileRequestHandler() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
sanitizeUri(java.lang.String uri) |
static void |
setContentTypeHeader(HttpServerResponse<io.netty.buffer.ByteBuf> response,
java.io.File file)
Sets the content type header for the HTTP Response
|
static void |
setDateAndCacheHeaders(HttpServerResponse<io.netty.buffer.ByteBuf> response,
java.io.File fileToCache)
Sets the Date and Cache headers for the HTTP Response
|
static void |
setDateHeader(HttpServerResponse<io.netty.buffer.ByteBuf> response,
java.text.SimpleDateFormat dateFormatter)
Sets the Date header for the HTTP response
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handle
public static final java.util.regex.Pattern INSECURE_URI
public static final java.util.regex.Pattern ALLOWED_FILE_NAME
public static final java.lang.String HTTP_DATE_FORMAT
public static final java.lang.String HTTP_DATE_GMT_TIMEZONE
public static final int HTTP_CACHE_SECONDS
public static void setDateHeader(HttpServerResponse<io.netty.buffer.ByteBuf> response, java.text.SimpleDateFormat dateFormatter)
response
- HTTP responsepublic static void setDateAndCacheHeaders(HttpServerResponse<io.netty.buffer.ByteBuf> response, java.io.File fileToCache)
response
- HTTP responsefileToCache
- file to extract content typepublic static void setContentTypeHeader(HttpServerResponse<io.netty.buffer.ByteBuf> response, java.io.File file)
response
- HTTP responsefile
- file to extract content typepublic static java.lang.String sanitizeUri(java.lang.String uri)