Class StaticFileHandler

java.lang.Object
org.yamcs.http.HttpHandler
org.yamcs.http.StaticFileHandler
Direct Known Subclasses:
AngularHandler

public class StaticFileHandler extends HttpHandler
  • Field Details

  • Constructor Details

    • StaticFileHandler

      public StaticFileHandler(String route, Path staticRoot)
    • StaticFileHandler

      public StaticFileHandler(String route, List<Path> staticRoots)
  • Method Details

    • requireAuth

      public boolean requireAuth()
      Specified by:
      requireAuth in class HttpHandler
    • setZeroCopyEnabled

      public void setZeroCopyEnabled(boolean zeroCopyEnabled)
    • setStaticRoots

      public void setStaticRoots(List<Path> staticRoots)
    • handle

      public void handle(HandlerContext ctx)
      Specified by:
      handle in class HttpHandler
    • getFilePath

      protected String getFilePath(HandlerContext ctx)
    • locateFile

      protected File locateFile(String path)
    • 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