|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.neu.ccs.demeterf.http.classes.HTTPResp
public class HTTPResp
Representation of HTTPResp
Nested Class Summary | |
---|---|
static class |
HTTPResp.body
Field Class for HTTPResp.body |
static class |
HTTPResp.keys
Field Class for HTTPResp.keys |
static class |
HTTPResp.label
Field Class for HTTPResp.label |
static class |
HTTPResp.resp
Field Class for HTTPResp.resp |
static class |
HTTPResp.ver
Field Class for HTTPResp.ver |
Field Summary | |
---|---|
static int |
ERROR
Basic Response Numbers |
static int |
OK
Basic Response Numbers |
static HTTPVer |
VER
Typical HTTP Version |
Constructor Summary | |
---|---|
HTTPResp(HTTPVer ver,
int resp,
ident label,
List<MsgHead> keys,
ident body)
Construct a(n) HTTPResp Instance |
Method Summary | |
---|---|
static HTTPResp |
create(int resp,
java.lang.String desc,
List<MsgHead> hds,
java.lang.String body)
Create a response with the given number, description, headers, and body |
boolean |
equals(java.lang.Object o)
Is the given object Equal to this HTTPResp? |
static HTTPResp |
error()
Create an (empty) Error Response |
static HTTPResp |
error(java.lang.String body)
Create an Error Response with a Body |
static HTTPResp |
fromInputStream(java.io.InputStream inpt)
Read a Response from an Input Stream |
static HTTPResp |
fromSocket(java.net.Socket s)
Read a Response from a Socket |
ident |
getBody()
Getter for field HTTPResp.body |
java.lang.String |
getBodyString()
Get the body of this Response |
Map<java.lang.String,java.lang.String> |
getHeaders()
Return the headers (key/value Map) of this Response |
List<MsgHead> |
getKeys()
Getter for field HTTPResp.keys |
ident |
getLabel()
Getter for field HTTPResp.label |
int |
getResp()
Getter for field HTTPResp.resp |
HTTPVer |
getVer()
Getter for field HTTPResp.ver |
static HTTPResp |
htmlError(java.lang.String body)
Create an HTML Error Response with a Body |
static HTTPResp |
htmlResponse(java.lang.String text)
Create an HTML Response |
boolean |
isError()
Is this Response an Error? |
boolean |
isOK()
Is this Response OK? |
static HTTPResp |
ok(java.lang.String type,
java.lang.String body)
Create an OK Response with the given Content-Type/Body |
static HTTPResp |
textResponse(java.lang.String text)
Create a Plain Text Response |
void |
toSocket(java.net.Socket s)
Write a Response to a Socket |
java.lang.String |
toString()
DGP method from Class PrintToString |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int OK
public static final int ERROR
public static final HTTPVer VER
Constructor Detail |
---|
public HTTPResp(HTTPVer ver, int resp, ident label, List<MsgHead> keys, ident body)
Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static HTTPResp create(int resp, java.lang.String desc, List<MsgHead> hds, java.lang.String body)
public static HTTPResp ok(java.lang.String type, java.lang.String body)
public static HTTPResp error()
public static HTTPResp error(java.lang.String body)
public static HTTPResp htmlError(java.lang.String body)
public static HTTPResp textResponse(java.lang.String text)
public static HTTPResp htmlResponse(java.lang.String text)
public boolean isOK()
public boolean isError()
public void toSocket(java.net.Socket s)
public static HTTPResp fromSocket(java.net.Socket s)
public static HTTPResp fromInputStream(java.io.InputStream inpt)
public java.lang.String getBodyString()
public Map<java.lang.String,java.lang.String> getHeaders()
public java.lang.String toString()
toString
in class java.lang.Object
public ident getBody()
public List<MsgHead> getKeys()
public ident getLabel()
public int getResp()
public HTTPVer getVer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |