public static StringWriter Getdata(String Indirizzo) {
String result="";
boolean check1 = false, check2 = false;
StringWriter mem= new StringWriter();
BufferedReader in=null;
PrintWriter copy = new PrintWriter(mem);
try {
URL url = new URL(Indirizzo);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
in = new BufferedReader(
new InputStreamReader(
conn.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
copy.println(inputLine);
}
in.close();
return mem;
} catch (MalformedURLException _error) {
System.out.println("URLException: " + _error.getMessage());
System.exit(1);
}
catch (IOException _error) {
System.out.println("IOException: " + _error.getMessage());
System.exit(1);
}
return null;
}