1 package com.indexdata.mkjsf.pazpar2.sp;
\r
3 import java.io.UnsupportedEncodingException;
\r
5 import com.indexdata.mkjsf.pazpar2.CommandResponse;
\r
7 public class ServiceProxyCommandResponse implements CommandResponse {
\r
9 private int statusCode = 0;
\r
10 private byte[] content = null;
\r
11 private String responseString = null;
\r
12 private String contentType = "";
\r
14 public ServiceProxyCommandResponse(int statusCode, byte[] content, String contentType) {
\r
15 this.statusCode = statusCode;
\r
16 this.content = content;
\r
17 this.contentType = contentType;
\r
20 public ServiceProxyCommandResponse(int statusCode, String contentString, String contentType) {
\r
21 this.statusCode = statusCode;
\r
22 this.contentType = contentType;
\r
23 this.responseString = contentString;
\r
27 public int getStatusCode() {
\r
32 public String getContentType() {
\r
33 return contentType;
\r
37 public String getResponseString() {
\r
38 if (content == null) {
\r
39 return responseString;
\r
42 return new String(content,"UTF-8");
\r
43 } catch (UnsupportedEncodingException e) {
\r
44 e.printStackTrace();
\r
45 return "<applicationerror><error>unsupported encoding</error></applicationerror>";
\r
51 public byte[] getBytes() {
\r
56 public boolean isBinary() {
\r
57 // TODO Auto-generated method stub
\r