|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.webdav.internal.kernel.Message
org.eclipse.webdav.internal.kernel.Response
public class Response
The Response
class subclasses Message
to
add a status field.
Field Summary | |
---|---|
protected Status |
status
|
Fields inherited from class org.eclipse.webdav.internal.kernel.Message |
---|
body, context |
Constructor Summary | |
---|---|
Response(Status status,
IContext context,
Document body)
|
|
Response(Status status,
IContext context,
InputStream body)
|
Method Summary | |
---|---|
void |
close()
Closes this response. |
Document |
getDocumentBody()
Gets the contents of the response body as a DOM Document . |
InputStream |
getInputStream()
Returns an open input stream for reading the the body of this response. |
int |
getStatusCode()
Return the status code for this response. |
String |
getStatusMessage()
Return the status message for this response. |
boolean |
hasDocumentBody()
Returns whether this response has an XML element as a body; this is the element that would be read if readDocumentBody() was called. |
String |
toString()
|
Methods inherited from class org.eclipse.webdav.internal.kernel.Message |
---|
getBody, getContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.webdav.IResponse |
---|
getContext |
Field Detail |
---|
protected Status status
Constructor Detail |
---|
public Response(Status status, IContext context, InputStream body)
public Response(Status status, IContext context, Document body)
Method Detail |
---|
public void close() throws IOException
IResponse
This method should be invoked on every response returned from the server without exception.
close
in interface IResponse
IOException
- if there was a problem closing this
responsepublic Document getDocumentBody() throws IOException
IResponse
Document
.
This response MUST have an XML body (i.e.,
hasDocumentBody()
must return true
).
Once the body has been read as an InputStream
it cannot be subsequently read as a Document
(the bytes have been consumed).
If a problem occurs parsing the document body an
IOException
is thrown.
getDocumentBody
in interface IResponse
IOException
- if there was a problem receiving the
response or interpreting it as XML.public InputStream getInputStream()
IResponse
This response must not have an XML body (i.e.,
hasElementBody()
must return false
).
The client may close the stream early, however, the resulting stream will be closed if necessary when the client closes this response.
getInputStream
in interface IResponse
InputStream
.public int getStatusCode()
Implements the corresponding API in the interface
Response
.
getStatusCode
in interface IResponse
getStatusCode()
public String getStatusMessage()
Implements the corresponding API in the interface
Response
.
getStatusMessage
in interface IResponse
getStatusMessage()
public boolean hasDocumentBody()
IResponse
readDocumentBody()
was called.
This method can be called numerous times, and can be called after the body has been read either as an InputStream or a Document -- all with no bad effect.
hasDocumentBody
in interface IResponse
true
if this message has a
document body and false
otherwise.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |