X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjavascript%2Fweb%2FClientResponse.java;h=9a9dba643b32095680634dbd47f45aabbd4cdb2e;hb=72bf348f1fcdf3faf9b9a064e246e4dbdd71860f;hp=e33dd984c3e0a6651de5950a9f9f6391c5b37d82;hpb=5a256ef0ca648a8f4722da20475cbd01655d9de4;p=jalview.git diff --git a/src/jalview/javascript/web/ClientResponse.java b/src/jalview/javascript/web/ClientResponse.java index e33dd98..9a9dba6 100644 --- a/src/jalview/javascript/web/ClientResponse.java +++ b/src/jalview/javascript/web/ClientResponse.java @@ -2,13 +2,19 @@ package jalview.javascript.web; import java.net.URI; +/** + * minimal implementation of com.sun.jersey.api.client.ClientResponse + * + * @author hansonr + * + */ public class ClientResponse { private String response; - private String encoding; + private String[] encoding; - public ClientResponse(String response, String encoding) + public ClientResponse(String response, String... encoding) { this.response = response; this.encoding = encoding; @@ -47,7 +53,7 @@ public class ClientResponse public int getStatus() { // note, we could get the actual response. I am just assuming it is 200 or 400 - return (response != null && (response.startsWith("{") == encoding.equals("application/json")) + return (response != null && (response.startsWith("{") == encoding[0].equals("application/json")) ? 200 : 400); }