public class WSResponse extends Object
Modifier and Type | Field and Description |
---|---|
String |
contentType |
Long |
size |
int |
status |
String |
statusDescription |
String |
statusName |
String |
url |
Constructor and Description |
---|
WSResponse(String url,
int status,
String statusName,
String statusDescription,
String contentType,
Long size,
InputStream bodyStream)
Creates a new Pipeline2WSResponse with the given HTTP status code, status name, status description and content body.
|
Modifier and Type | Method and Description |
---|---|
File |
asFile()
Returns the response body as a File.
|
InputStream |
asStream()
Returns the response body as a InputStream.
|
String |
asText()
Returns the response body as a String.
|
Document |
asXml()
Returns the response body as an XML Document.
|
public String url
public int status
public String statusName
public String statusDescription
public String contentType
public Long size
public WSResponse(String url, int status, String statusName, String statusDescription, String contentType, Long size, InputStream bodyStream)
url
- the URLstatus
- the HTTP statusstatusName
- the HTTP status namestatusDescription
- the HTTP status descriptioncontentType
- the content typesize
- the size of the bodybodyStream
- the body as a InputStreampublic String asText() throws Pipeline2Exception
Pipeline2Exception
- thrown if an error occurspublic InputStream asStream() throws Pipeline2Exception
Pipeline2Exception
- thrown if an error occurspublic Document asXml() throws Pipeline2Exception
Pipeline2Exception
- thrown if an error occurspublic File asFile() throws Pipeline2Exception
Pipeline2Exception
- thrown if an error occursCopyright © 2012–2022 The DAISY Consortium. All rights reserved.