Package org.cybergarage.http
Class HTTPPacket
java.lang.Object
org.cybergarage.http.HTTPPacket
- Direct Known Subclasses:
HTTPRequest
,HTTPResponse
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addHeader
(HTTPHeader header) void
byte[]
long
long[]
long
long
long
getDate()
protected String
protected String
getFirstLineToken
(int num) getHeader
(int n) getHeaderValue
(String name) getHost()
int
getIntegerHeaderValue
(String name) long
getLongHeaderValue
(String name) int
getStringHeaderValue
(String name) getStringHeaderValue
(String name, String startWidth, String endWidth) boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
init()
boolean
boolean
boolean
boolean
read
(HTTPSocket httpSock) protected boolean
set
(InputStream in) protected boolean
set
(InputStream in, boolean onlyHeaders) protected void
set
(HTTPPacket httpPacket) protected boolean
set
(HTTPSocket httpSock) void
setCacheControl
(int value) void
setCacheControl
(String directive) void
setCacheControl
(String directive, int value) void
setConnection
(String value) void
setContent
(byte[] data) void
setContent
(byte[] data, boolean updateWithContentLength) void
setContent
(String data) void
setContent
(String data, boolean updateWithContentLength) void
void
setContentLanguage
(String code) void
setContentLength
(long len) void
setContentRange
(long firstPos, long lastPos, long length) void
setContentType
(String type) void
void
void
void
void
setHeader
(HTTPHeader header) void
void
void
setIntegerHeader
(String name, int value) void
setLongHeader
(String name, long value) void
void
setStringHeader
(String name, String value) void
setStringHeader
(String name, String value, String startWidth, String endWidth) void
setTransferEncoding
(String value) void
setVersion
(String ver)
-
Constructor Details
-
HTTPPacket
public HTTPPacket() -
HTTPPacket
-
HTTPPacket
-
-
Method Details
-
init
public void init() -
setVersion
-
getVersion
-
set
-
set
-
set
-
set
-
read
-
getFirstLine
-
getFirstLineToken
-
hasFirstLine
public boolean hasFirstLine() -
getNHeaders
public int getNHeaders() -
addHeader
-
addHeader
-
getHeader
-
getHeader
-
clearHeaders
public void clearHeaders() -
hasHeader
-
setHeader
-
setHeader
-
setHeader
-
setHeader
-
getHeaderValue
-
setStringHeader
-
setStringHeader
-
getStringHeaderValue
-
getStringHeaderValue
-
setIntegerHeader
-
setLongHeader
-
getIntegerHeaderValue
-
getLongHeaderValue
-
getHeaderString
-
setContent
public void setContent(byte[] data, boolean updateWithContentLength) -
setContent
public void setContent(byte[] data) -
setContent
-
setContent
-
getContent
public byte[] getContent() -
getContentString
-
hasContent
public boolean hasContent() -
setContentInputStream
-
getContentInputStream
-
hasContentInputStream
public boolean hasContentInputStream() -
setContentType
-
getContentType
-
setContentLanguage
-
getContentLanguage
-
getCharSet
-
setContentLength
public void setContentLength(long len) -
getContentLength
public long getContentLength() -
hasConnection
public boolean hasConnection() -
setConnection
-
getConnection
-
isCloseConnection
public boolean isCloseConnection() -
isKeepAliveConnection
public boolean isKeepAliveConnection() -
hasContentRange
public boolean hasContentRange() -
setContentRange
public void setContentRange(long firstPos, long lastPos, long length) -
getContentRange
public long[] getContentRange() -
getContentRangeFirstPosition
public long getContentRangeFirstPosition() -
getContentRangeLastPosition
public long getContentRangeLastPosition() -
getContentRangeInstanceLength
public long getContentRangeInstanceLength() -
setCacheControl
-
setCacheControl
-
setCacheControl
public void setCacheControl(int value) -
getCacheControl
-
setServer
-
getServer
-
setHost
-
setHost
-
getHost
-
setDate
-
getDate
-
hasTransferEncoding
public boolean hasTransferEncoding() -
setTransferEncoding
-
getTransferEncoding
-
isChunked
public boolean isChunked()
-