+ \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
+ Path path = Paths.get(filePath);\r
+ if (logger.isDebugEnabled()) {\r
+ try (Scanner scanner = new Scanner(path, "UTF-8")){\r
+ while (scanner.hasNextLine()){\r
+ System.out.println(scanner.nextLine());\r
+ } \r
+ } \r
+ }\r
+ post.setEntity(new FileEntity(initDoc));\r
+ byte[] response = client.execute(post, handler);\r
+ logger.info("Response on POST was: " + new String(response,"UTF-8")); \r
+ return response;\r
+ }\r
+ \r
+ public String[] getInitDocPaths () {\r
+ logger.info("Get init doc paths ");\r
+ logger.info("length: " + initDocPaths.length);\r
+ return initDocPaths;\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