I want to use XPath (in Java) to parse XML files. However these XML files are only available on the web (downloading them all manually is not an option (of course they have to be "downloaded" in order to be processed).
So basically my question is how to do I take a URI object and convert it into a File object. Do I need to use SCP or something in between to download the file. Any code, tutorials or just general advice would be much appreciated.
I had tried this:
URI uri = new URI("http://www.somefiles.com/myfile.xml");
InputStream is = uri.toURL().openStream();
File xmlDocument = new File(uri);
But this gave a URI scheme is not "file"
error.