Class StaticFileHandler


  • public class StaticFileHandler
    extends Object
    • Constructor Detail

      • StaticFileHandler

        public StaticFileHandler()
    • Method Detail

      • 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