java.lang.Object
org.yamcs.http.StaticFileHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleStaticFileRequest(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest req, String rawPath) static voidprotected FilelocateFile(String path) protected voidsetContentTypeHeader(io.netty.handler.codec.http.HttpResponse response, File file) Sets the content type header for the HTTP Responseprotected static voidsetDateHeader(io.netty.handler.codec.http.HttpResponse response) Sets the Date header for the HTTP response
-
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:
-
-
Constructor Details
-
StaticFileHandler
public StaticFileHandler()
-
-
Method Details
-
init
public static void init(List<String> staticRoots, boolean zeroCopyEnabled) throws ConfigurationException - Throws:
ConfigurationException
-
locateFile
-
handleStaticFileRequest
public void handleStaticFileRequest(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest req, String rawPath) throws IOException - Throws:
IOException
-
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
-