Top Description Inners Fields Constructors Methods
org.eclipse.jetty.http

public Class HttpTokens

extends Object
Class Inheritance
Imports
org.eclipse.jetty.util.TypeUtil

HTTP constants

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static class
public static enum

Field Summary

Modifier and TypeField and Description
pack-priv static final byte
pack-priv static final byte
pack-priv static final byte[]
pack-priv static final byte
pack-priv static final byte
pack-priv static final byte
public static final HttpTokens.Token[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static HttpTokens.Token
getToken(byte b)

public static HttpTokens.Token
getToken(char c)

public static boolean

Returns:

true if this is invalid VCHAR.
isIllegalFieldVchar
(char
the character to test.
c
)

Checks whether this is an invalid VCHAR based on RFC9110.

public static char

Returns:

the original character or the replacement character ' ' or '?', the return value is guaranteed to be a valid ISO-8859-1 character.
sanitizeFieldVchar
(char
the character to test.
c
)

This is used when decoding to not decode illegal characters based on RFC9110.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CARRIAGE_RETURNback to summary
pack-priv static final byte CARRIAGE_RETURN
COLONback to summary
pack-priv static final byte COLON
CRLFback to summary
pack-priv static final byte[] CRLF
LINE_FEEDback to summary
pack-priv static final byte LINE_FEED
SPACEback to summary
pack-priv static final byte SPACE
TABback to summary
pack-priv static final byte TAB
TOKENSback to summary
public static final HttpTokens.Token[] TOKENS

Constructor Detail

HttpTokensback to summary
public HttpTokens()

Method Detail

getTokenback to summary
public static HttpTokens.Token getToken(byte b)
getTokenback to summary
public static HttpTokens.Token getToken(char c)
isIllegalFieldVcharback to summary
public static boolean isIllegalFieldVchar(char c)

Checks whether this is an invalid VCHAR based on RFC9110. If this not a valid ISO-8859-1 character or a control character we say that it is illegal.

Parameters
c:char

the character to test.

Returns:boolean

true if this is invalid VCHAR.

sanitizeFieldVcharback to summary
public static char sanitizeFieldVchar(char c)

This is used when decoding to not decode illegal characters based on RFC9110. CR, LF, or NUL are replaced with ' ', all other control and multibyte characters are replaced with '?'. If this is given a legal character the same value will be returned.

field-vchar = VCHAR / obs-text
obs-text    = %x80-FF
VCHAR       = %x21-7E
Parameters
c:char

the character to test.

Returns:char

the original character or the replacement character ' ' or '?', the return value is guaranteed to be a valid ISO-8859-1 character.

org.eclipse.jetty.http back to summary

public final Enum HttpTokens.EndOfContent

extends Enum<HttpTokens.EndOfContent>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final HttpTokens.EndOfContent
public static final HttpTokens.EndOfContent
public static final HttpTokens.EndOfContent
public static final HttpTokens.EndOfContent
public static final HttpTokens.EndOfContent

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static HttpTokens.EndOfContent
public static HttpTokens.EndOfContent[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CHUNKED_CONTENTback to summary
public static final HttpTokens.EndOfContent CHUNKED_CONTENT
CONTENT_LENGTHback to summary
public static final HttpTokens.EndOfContent CONTENT_LENGTH
EOF_CONTENTback to summary
public static final HttpTokens.EndOfContent EOF_CONTENT
NO_CONTENTback to summary
public static final HttpTokens.EndOfContent NO_CONTENT
UNKNOWN_CONTENTback to summary
public static final HttpTokens.EndOfContent UNKNOWN_CONTENT

Constructor Detail

EndOfContentback to summary
private EndOfContent()

Method Detail

valueOfback to summary
public static HttpTokens.EndOfContent valueOf(String name)
valuesback to summary
public static HttpTokens.EndOfContent[] values()
org.eclipse.jetty.http back to summary

public Class HttpTokens.Token

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final byte
private final char
private final boolean
private final boolean
private final HttpTokens.Type
private final int

Constructor Summary

AccessConstructor and Description
private
Token(byte b, HttpTokens.Type type)

Method Summary

Modifier and TypeMethod and Description
public byte
public char
public int
public HttpTokens.Type
public boolean
public boolean
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_bback to summary
private final byte _b
_cback to summary
private final char _c
_rfc2616Tokenback to summary
private final boolean _rfc2616Token
_rfc6265CookieOctetback to summary
private final boolean _rfc6265CookieOctet
_typeback to summary
private final HttpTokens.Type _type
_xback to summary
private final int _x

Constructor Detail

Tokenback to summary
private Token(byte b, HttpTokens.Type type)

Method Detail

getByteback to summary
public byte getByte()
getCharback to summary
public char getChar()
getHexDigitback to summary
public int getHexDigit()
getTypeback to summary
public HttpTokens.Type getType()
isHexDigitback to summary
public boolean isHexDigit()
isRfc2616Tokenback to summary
public boolean isRfc2616Token()
isRfc6265CookieOctetback to summary
public boolean isRfc6265CookieOctet()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.http back to summary

public final Enum HttpTokens.Type

extends Enum<HttpTokens.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type
public static final HttpTokens.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static HttpTokens.Type
public static HttpTokens.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALPHAback to summary
public static final HttpTokens.Type ALPHA
CNTLback to summary
public static final HttpTokens.Type CNTL
COLONback to summary
public static final HttpTokens.Type COLON
CRback to summary
public static final HttpTokens.Type CR
DIGITback to summary
public static final HttpTokens.Type DIGIT
HTABback to summary
public static final HttpTokens.Type HTAB
LFback to summary
public static final HttpTokens.Type LF
OTEXTback to summary
public static final HttpTokens.Type OTEXT
SPACEback to summary
public static final HttpTokens.Type SPACE
TCHARback to summary
public static final HttpTokens.Type TCHAR
VCHARback to summary
public static final HttpTokens.Type VCHAR

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static HttpTokens.Type valueOf(String name)
valuesback to summary
public static HttpTokens.Type[] values()