\r
import static com.indexdata.pz2utils4jsf.utils.Utils.nl;\r
\r
+import java.io.BufferedReader;\r
import java.io.ByteArrayOutputStream;\r
import java.io.File;\r
+import java.io.FileReader;\r
import java.io.IOException;\r
import java.util.ArrayList;\r
import java.util.HashMap;\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
- /*\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
+ 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
- */\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
+ logger.debug("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
+ logger.debug("Get init doc paths ");\r
+ logger.debug("length: " + initDocPaths.length);\r
return initDocPaths;\r
}\r
\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.info("Response on POST was: " + new String(response,"UTF-8")); \r
+ logger.debug("Response on POST was: " + new String(response,"UTF-8")); \r
return response;\r
}\r
\r