Class StaticFileHandler

java.lang.Object
org.yamcs.http.StaticFileHandler

public class StaticFileHandler extends Object
  • Field Details

  • Constructor Details

    • StaticFileHandler

      public StaticFileHandler()
  • Method Details

    • init

      public static void init(List<String> staticRoots, boolean zeroCopyEnabled) throws ConfigurationException
      Throws:
      ConfigurationException
    • locateFile

      protected File locateFile(String path)
    • handleStaticFileRequest

      public void handleStaticFileRequest(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest req, String rawPath) throws IOException
      Throws:
      IOException
    • setContentTypeHeader

      protected void setContentTypeHeader(io.netty.handler.codec.http.HttpResponse response, File file)
      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