This commit is contained in:
Gianpaolo Coro 2015-10-22 13:40:03 +00:00
parent a79f27d4a1
commit 6e6b0359e2
1 changed files with 5 additions and 19 deletions

View File

@ -144,12 +144,8 @@ public class DivaHTTPClient {
new BufferedReader(new InputStreamReader(responseStream));
String line = "";
//DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance();
StringBuilder stringBuilder = new StringBuilder();
//ByteArrayInputStream input;
//DocumentBuilder builder = factory.newDocumentBuilder();
while ((line = responseStreamReader.readLine()) != null) {
stringBuilder.append(line).append("\n");
}
@ -159,20 +155,9 @@ public class DivaHTTPClient {
String response = stringBuilder.toString();
//input = new ByteArrayInputStream(stringBuilder.toString().getBytes("UTF-8"));
System.out.println("RESPONSE STRING: "+response);
//System.out.println("RESPONSE STRING: "+response);
Document doc = loadXMLFromString(response);
//Node root = doc.getDocumentElement();
System.out.println("ELEMENTBYTAG: "+doc.getElementsByTagName("stat").item(0).getTextContent());
//System.out.println("ROOT: "+root.getTextContent());
//System.out.println("INSIDE: "+ root.getChildNodes().item(2).getTextContent());
//System.out.println("BYID: "+doc.getElementById("vmin").getNodeValue());
//System.out.println("BYID: "+doc.getChildNodes().item(2));
Double vmin = Double.parseDouble(doc.getElementsByTagName("stat").item(0).getTextContent());
Double vmax = Double.parseDouble(doc.getElementsByTagName("stat").item(1).getTextContent());
@ -240,8 +225,9 @@ public class DivaHTTPClient {
DivaFilePostResponse response=uploadFile(new File("C:"+File.separator+"Users"+File.separator+"marbas"+File.separator+"Desktop"+File.separator+"temperature_argo.txt"));
System.out.println(getAnalysis(response.getSessionid(),5,4,76,78,1,35,78,1,2));
System.out.println(response);
//System.out.println(getAnalysis(response.getSessionid(),5,4,76,78,1,35,78,1,2));
//System.out.println(response);
DivaAnalysisGetResponse respAnalysis = getAnalysis(response.getSessionid(),5, 4, 76, 78, 1, 35, 78, 1, 2);
}