how can i get an xml file from a url to a file on my desktop using java 8? i tried using the BufferedReader and StringBuilder which downloads the file on the console,
is there another way of doing it so that I get the xml file on my desktop and extract the information that I need ? my code:
URL url1 = new URL("http://api.eancdn.com/ean-services/rs/hotel/v3/list?cid=55505&minorRev=28&apiKey=m9sur8fsbdemjck7y9yydmfx&locale=en_EN¤cyCode=USD&latitude=42.50631740000001&longitude=1.5218355");
InputStream is1 = url1.openStream();
BufferedReader br1 = new BufferedReader(new InputStreamReader(is1));
StringBuilder sb = new StringBuilder();
String line;
while((line=br1.readLine())!=null){
sb.append(line +"\n");
}
System.out.println(sb.toString());