+ \r
+ public byte[] postInitDoc (String filePath) throws IOException {\r
+ logger.info("Looking to post the file in : [" + filePath +"]");\r
+ HttpPost post = new HttpPost(serviceUrl+"?command=init&includeDebug=yes");\r
+ File initDoc = new File(filePath);\r
+ logger.info("Posting to SP: ");\r
+ if (logger.isDebugEnabled()) {\r
+ BufferedReader reader = new BufferedReader(new FileReader(initDoc));\r
+ String line;\r
+ while ( (line = reader.readLine()) != null) {\r
+ System.out.println(line);\r
+ }\r
+ reader.close();\r
+ }\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
+ }\r
+ \r
+ public String[] getInitDocPaths () {\r
+ logger.debug("Get init doc paths ");\r
+ logger.debug("length: " + initDocPaths.length);\r
+ return initDocPaths;\r
+ }\r
+ \r
+ public byte[] postInitDoc(byte[] initDoc) throws IOException {\r
+ HttpPost post = new HttpPost(serviceUrl+"?command=init&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
+ }\r
+ \r
+ public void setServiceProxyUrl (String url) {\r
+ serviceUrl = url;\r
+ }\r
+ \r
+ public String getServiceProxyUrl () {\r
+ return serviceUrl;\r
+ }\r
+ \r
+ public Configuration getConfiguration () {\r
+ return config;\r
+ }\r
+ \r