Package org.eclipse.jetty.http
Class HttpGenerator
- java.lang.Object
-
- org.eclipse.jetty.http.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpGenerator.Result
static class
HttpGenerator.State
-
Field Summary
Fields Modifier and Type Field Description static boolean
__STRICT
static int
CHUNK_SIZE
static MetaData.Response
CONTINUE_100_INFO
static MetaData.Response
PROGRESS_102_INFO
static MetaData.Response
RESPONSE_500_INFO
-
Constructor Summary
Constructors Constructor Description HttpGenerator()
HttpGenerator(boolean sendServerVersion, boolean sendXPoweredBy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
abort()
HttpGenerator.Result
generateRequest(MetaData.Request info, java.nio.ByteBuffer header, java.nio.ByteBuffer chunk, java.nio.ByteBuffer content, boolean last)
HttpGenerator.Result
generateResponse(MetaData.Response info, boolean head, java.nio.ByteBuffer header, java.nio.ByteBuffer chunk, java.nio.ByteBuffer content, boolean last)
HttpGenerator.Result
generateResponse(MetaData.Response info, java.nio.ByteBuffer header, java.nio.ByteBuffer chunk, java.nio.ByteBuffer content, boolean last)
Deprecated.long
getContentPrepared()
static byte[]
getReasonBuffer(int code)
boolean
getSendServerVersion()
Deprecated.HttpGenerator.State
getState()
boolean
isChunking()
boolean
isCommitted()
boolean
isEnd()
boolean
isIdle()
boolean
isNoContent()
boolean
isPersistent()
boolean
isState(HttpGenerator.State state)
boolean
isWritten()
static void
putTo(HttpField field, java.nio.ByteBuffer bufferInFillMode)
static void
putTo(HttpFields fields, java.nio.ByteBuffer bufferInFillMode)
void
reset()
static void
setJettyVersion(java.lang.String serverVersion)
void
setPersistent(boolean persistent)
void
setSendServerVersion(boolean sendServerVersion)
Deprecated.java.lang.String
toString()
-
-
-
Field Detail
-
__STRICT
public static final boolean __STRICT
-
CONTINUE_100_INFO
public static final MetaData.Response CONTINUE_100_INFO
-
PROGRESS_102_INFO
public static final MetaData.Response PROGRESS_102_INFO
-
RESPONSE_500_INFO
public static final MetaData.Response RESPONSE_500_INFO
-
CHUNK_SIZE
public static final int CHUNK_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setJettyVersion
public static void setJettyVersion(java.lang.String serverVersion)
-
reset
public void reset()
-
getSendServerVersion
@Deprecated public boolean getSendServerVersion()
Deprecated.
-
setSendServerVersion
@Deprecated public void setSendServerVersion(boolean sendServerVersion)
Deprecated.
-
getState
public HttpGenerator.State getState()
-
isState
public boolean isState(HttpGenerator.State state)
-
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
@Deprecated public HttpGenerator.Result generateResponse(MetaData.Response info, java.nio.ByteBuffer header, java.nio.ByteBuffer chunk, java.nio.ByteBuffer content, boolean last) throws java.io.IOException
Deprecated.- 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
-
getReasonBuffer
public static byte[] getReasonBuffer(int code)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
putTo
public static void putTo(HttpField field, java.nio.ByteBuffer bufferInFillMode)
-
putTo
public static void putTo(HttpFields fields, java.nio.ByteBuffer bufferInFillMode)
-
-