Is anyone aware of a quick way of reading in an xml file over http? (e.g. i have a file located in http://www.abc.com/file.xml). How can i read this file from a java app
All help is greatly appreciated
Thanks Damien
Use java.net.URL
to get an InputStream
:
final URL url = new URL("http://www.abc.com/file.xml");
final InputStream in = new BufferedInputStream(url.openStream());
// Read the input stream as usual
Exception handling and stuff omitted for brevity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With