Package org.yamcs.http
Class StaticFileHandler
java.lang.Object
org.yamcs.http.HttpHandler
org.yamcs.http.StaticFileHandler
- Direct Known Subclasses:
AngularHandler
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final String
static final String
protected String
Fields inherited from class org.yamcs.http.HttpHandler
log, MIME
-
Constructor Summary
ConstructorDescriptionStaticFileHandler
(String route, Path staticRoot) StaticFileHandler
(String route, List<Path> staticRoots) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
handle
(HandlerContext ctx) protected File
locateFile
(String path) boolean
protected void
setContentTypeHeader
(io.netty.handler.codec.http.HttpResponse response, File file) Sets the content type header for the HTTP Responseprotected static void
setDateHeader
(io.netty.handler.codec.http.HttpResponse response) Sets the Date header for the HTTP responsevoid
setStaticRoots
(List<Path> staticRoots) void
setZeroCopyEnabled
(boolean zeroCopyEnabled) Methods inherited from class org.yamcs.http.HttpHandler
doHandle, getAccessTokenFromCookie
-
Field Details
-
HTTP_CACHE_SECONDS
public static final int HTTP_CACHE_SECONDS- See Also:
-
HTTP_DATE_FORMAT
- See Also:
-
HTTP_DATE_GMT_TIMEZONE
- See Also:
-
route
-
staticRoots
-
-
Constructor Details
-
StaticFileHandler
-
StaticFileHandler
-
-
Method Details
-
requireAuth
public boolean requireAuth()- Specified by:
requireAuth
in classHttpHandler
-
setZeroCopyEnabled
public void setZeroCopyEnabled(boolean zeroCopyEnabled) -
setStaticRoots
-
handle
- Specified by:
handle
in classHttpHandler
-
getFilePath
-
locateFile
-
setContentTypeHeader
Sets the content type header for the HTTP Response- Parameters:
file
- file to extract content type
-
setDateHeader
protected static void setDateHeader(io.netty.handler.codec.http.HttpResponse response) Sets the Date header for the HTTP response
-