[MOBY-guts] biomoby commit
Gary Schlitz
gss at pub.open-bio.org
Sat Mar 27 01:14:22 UTC 2004
gss
Fri Mar 26 20:14:22 EST 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/common/http
In directory pub.open-bio.org:/tmp/cvs-serv2417/org/smoby/tools/common/http
Modified Files:
HTTPResponse.java
Log Message:
More reorganization
moby-live/S-MOBY/ref-impl/core/org/smoby/tools/common/http HTTPResponse.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/common/http/HTTPResponse.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/common/http/HTTPResponse.java 2004/03/20 00:29:15 1.2
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/org/smoby/tools/common/http/HTTPResponse.java 2004/03/27 01:14:22 1.3
@@ -35,35 +35,51 @@
* outcome to the command that was executed.
*/
public boolean isSuccessful()
+ throws HTTPException
{
- return method.getStatusCode() == HttpStatus.SC_OK;
+ try {
+ return method.getStatusCode() == HttpStatus.SC_OK;
+ } catch (Throwable t) {
+ throw new HTTPException("Unable to check success", t);
+ }
}
/**
* Return the HTTP Status code returned by the server.
*/
public int getStatus()
+ throws HTTPException
{
- return method.getStatusCode();
+ try {
+ return method.getStatusCode();
+ } catch (Throwable t) {
+ throw new HTTPException("Unable to get return status", t);
+ }
}
/**
* Return the HTTP Status text that was returned by the server.
*/
public String getStatusText()
+ throws HTTPException
{
- return HttpStatus.getStatusText(method.getStatusCode());
+ try {
+ return HttpStatus.getStatusText(method.getStatusCode());
+ } catch (Throwable t) {
+ throw new HTTPException("Unable to get status text", t);
+ }
}
/**
* Return the response body returned by the server.
*/
public String getBody()
+ throws HTTPException
{
try {
return method.getResponseBodyAsString();
- } catch (IOException e) {
- return "";
+ } catch (Throwable t) {
+ throw new HTTPException("Unable to get response body", t);
}
}
@@ -74,7 +90,12 @@
* @return the value of the named header field
*/
public String getHeaderValue(String headerName)
+ throws HTTPException
{
- return method.getResponseHeader(headerName).getValue();
+ try {
+ return method.getResponseHeader(headerName).getValue();
+ } catch (Throwable t) {
+ throw new HTTPException("Unable to get header value", t);
+ }
}
}
\ No newline at end of file
More information about the MOBY-guts
mailing list