Class FileErrorPageHandler

  • All Implemented Interfaces:
    HttpHandler

    public class FileErrorPageHandler
    extends java.lang.Object
    implements HttpHandler
    Handler that serves up a file from disk to serve as an error page.

    This handler does not server up and response codes by default, you must configure the response codes it responds to.

    Author:
    Stuart Douglas
    • Constructor Detail

      • FileErrorPageHandler

        @Deprecated
        public FileErrorPageHandler​(java.io.File file,
                                    java.lang.Integer... responseCodes)
        Deprecated.
      • FileErrorPageHandler

        public FileErrorPageHandler​(java.nio.file.Path file,
                                    java.lang.Integer... responseCodes)
      • FileErrorPageHandler

        @Deprecated
        public FileErrorPageHandler​(HttpHandler next,
                                    java.io.File file,
                                    java.lang.Integer... responseCodes)
        Deprecated.
      • FileErrorPageHandler

        public FileErrorPageHandler​(HttpHandler next,
                                    java.nio.file.Path file,
                                    java.lang.Integer... responseCodes)
      • FileErrorPageHandler

        public FileErrorPageHandler​(HttpHandler next,
                                    java.nio.file.Path file,
                                    MimeMappings mimeMappings,
                                    java.lang.Integer... responseCodes)
    • Method Detail

      • handleRequest

        public void handleRequest​(HttpServerExchange exchange)
                           throws java.lang.Exception
        Description copied from interface: HttpHandler
        Handle the request.
        Specified by:
        handleRequest in interface HttpHandler
        Parameters:
        exchange - the HTTP request/response exchange
        Throws:
        java.lang.Exception
      • getResponseCodes

        public java.util.Set<java.lang.Integer> getResponseCodes()
      • setResponseCodes

        public FileErrorPageHandler setResponseCodes​(java.util.Set<java.lang.Integer> responseCodes)
      • setResponseCodes

        public FileErrorPageHandler setResponseCodes​(java.lang.Integer... responseCodes)
      • getFile

        public java.nio.file.Path getFile()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object