logger.info(Utils.objectId(this) + " is configuring using the provided " + Utils.objectId(configReader));\r
try {\r
config = configReader.getConfiguration(this); \r
- serviceUrls = getMultiProperty(config.get(SERVICE_PROXY_URL));\r
+ serviceUrls = getMultiProperty(config.get(SERVICE_PROXY_URL),",");\r
if (serviceUrls.size()==1) {\r
selectedServiceUrl = serviceUrls.get(0);\r
}\r
- this.initDocPaths = getMultiProperty(config.get(SP_INIT_DOC_PATHS));\r
+ this.initDocPaths = getMultiProperty(config.get(SP_INIT_DOC_PATHS),",");\r
checkAuth = new AuthCommand(null);\r
checkAuth.setParameterInState(new CommandParameter("action","=","check"));\r
ipAuth = new AuthCommand(null);\r
} \r
}\r
\r
- private List<String> getMultiProperty(String prop) {\r
+ private List<String> getMultiProperty(String prop, String separator) {\r
List<String> props = new ArrayList<String>();\r
if (prop != null) { \r
- StringTokenizer tokenizer = new StringTokenizer(prop,",");\r
+ StringTokenizer tokenizer = new StringTokenizer(prop,separator);\r
while (tokenizer.hasMoreElements()) {\r
props.add(tokenizer.nextToken());\r
} \r
return null;\r
}\r
\r
- public byte[] postInitDoc (String filePath) throws IOException {\r
+ public ServiceProxyCommandResponse postInitDoc (String filePath) throws IOException {\r
logger.info("Looking to post the file in : [" + filePath +"]");\r
HttpPost post = new HttpPost(selectedServiceUrl+"?command=init&includeDebug=yes");\r
File initDoc = new File(filePath);\r
post.setEntity(new FileEntity(initDoc));\r
byte[] response = client.execute(post, handler);\r
logger.debug("Response on POST was: " + new String(response,"UTF-8")); \r
- return response;\r
+ return new ServiceProxyCommandResponse(handler.getStatusCode(),response,handler.getContentType()); \r
}\r
\r
public List<String> getInitDocPaths () {\r
return initDocPaths;\r
}\r
\r
- public byte[] postInitDoc(byte[] initDoc, boolean includeDebug) throws IOException {\r
+ public ServiceProxyCommandResponse postInitDoc(byte[] initDoc, boolean includeDebug) throws IOException {\r
HttpPost post = new HttpPost(selectedServiceUrl+"?command=init" + (includeDebug? "&includeDebug=yes" : ""));\r
post.setEntity(new ByteArrayEntity(initDoc));\r
byte[] response = client.execute(post, handler);\r
logger.debug("Response on POST was: " + new String(response,"UTF-8")); \r
- return response;\r
+ return new ServiceProxyCommandResponse(handler.getStatusCode(),response,handler.getContentType()); \r
}\r
\r
public void setServiceProxyUrl (String url) {\r