Class WebThread

  • All Implemented Interfaces:
    java.lang.Runnable

    class WebThread
    extends WebApp
    implements java.lang.Runnable
    For each connection to a session, an object of this class is created. This class is used by the H2 Console.
    • Field Detail

      • RN

        private static final byte[] RN
      • RNRN

        private static final byte[] RNRN
      • output

        protected java.io.OutputStream output
      • socket

        protected final java.net.Socket socket
      • thread

        private final java.lang.Thread thread
      • input

        private java.io.InputStream input
      • host

        private java.lang.String host
      • dataLength

        private int dataLength
      • ifModifiedSince

        private java.lang.String ifModifiedSince
    • Constructor Detail

      • WebThread

        WebThread​(java.net.Socket socket,
                  WebServer server)
    • Method Detail

      • start

        void start()
        Start the thread.
      • join

        void join​(int millis)
           throws java.lang.InterruptedException
        Wait until the thread is stopped.
        Parameters:
        millis - the maximum number of milliseconds to wait
        Throws:
        java.lang.InterruptedException - if interrupted
      • stopNow

        void stopNow()
        Close the connection now.
      • getAllowedFile

        private java.lang.String getAllowedFile​(java.lang.String requestedFile)
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • process

        private boolean process()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSimple

        private void writeSimple​(java.lang.String status,
                                 java.lang.String text)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSimple

        private void writeSimple​(java.lang.String status,
                                 byte[] bytes)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • checkHost

        private boolean checkHost​(java.lang.String host)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readHeaderLine

        private java.lang.String readHeaderLine()
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • parseBodyAttributes

        private void parseBodyAttributes()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • parseAttributes

        private void parseAttributes​(java.lang.String s)
      • parseHeader

        private boolean parseHeader()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getHeaderLineValue

        private static java.lang.String getHeaderLineValue​(java.lang.String line)
      • adminShutdown

        protected java.lang.String adminShutdown()
        Description copied from class: WebApp
        Stop the application and the server.
        Overrides:
        adminShutdown in class WebApp
        Returns:
        the page to display
      • allow

        private boolean allow()
      • trace

        private void trace​(java.lang.String s)