Class HttpGenerator


  • public class HttpGenerator
    extends java.lang.Object
    HttpGenerator. Builds HTTP Messages.

    If the system property "org.eclipse.jetty.http.HttpGenerator.STRICT" is set to true, then the generator will strictly pass on the exact strings received from methods and header fields. Otherwise a fast case insensitive string lookup is used that may alter the case and white space of some methods/headers

    • Constructor Detail

      • HttpGenerator

        public HttpGenerator()
      • HttpGenerator

        public HttpGenerator​(boolean sendServerVersion,
                             boolean sendXPoweredBy)
    • Method Detail

      • setJettyVersion

        public static void setJettyVersion​(java.lang.String serverVersion)
      • reset

        public void reset()
      • isIdle

        public boolean isIdle()
      • isEnd

        public boolean isEnd()
      • isCommitted

        public boolean isCommitted()
      • isChunking

        public boolean isChunking()
      • isNoContent

        public boolean isNoContent()
      • setPersistent

        public void setPersistent​(boolean persistent)
      • isPersistent

        public boolean isPersistent()
        Returns:
        true if known to be persistent
      • isWritten

        public boolean isWritten()
      • getContentPrepared

        public long getContentPrepared()
      • abort

        public void abort()
      • generateRequest

        public HttpGenerator.Result generateRequest​(MetaData.Request info,
                                                    java.nio.ByteBuffer header,
                                                    java.nio.ByteBuffer chunk,
                                                    java.nio.ByteBuffer content,
                                                    boolean last)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • generateResponse

        public HttpGenerator.Result generateResponse​(MetaData.Response info,
                                                     boolean head,
                                                     java.nio.ByteBuffer header,
                                                     java.nio.ByteBuffer chunk,
                                                     java.nio.ByteBuffer content,
                                                     boolean last)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • servletUpgrade

        public void servletUpgrade()
      • getReasonBuffer

        public static byte[] getReasonBuffer​(int code)
      • toString

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

        public static void putTo​(HttpField field,
                                 java.nio.ByteBuffer bufferInFillMode)
      • putTo

        public static void putTo​(HttpFields.Mutable fields,
                                 java.nio.ByteBuffer bufferInFillMode)