Parag M
Parag M

Reputation: 93

Reading a xml file remotely

I have a standalone Java based desktop application. This application uses a property file (in simple text format) which needs to updated periodically. To do that, this application should connect to a remote server , read a xml file located there and update my property file based on the data in the xml. How can I do this ?

Upvotes: 0

Views: 166

Answers (1)

D'yer Mak'er
D'yer Mak'er

Reputation: 1632

Make use of class url

URL url = new URL("http://yourremoteserver.com/file_to_be_read.xml");
 URLConnection urlConnection = url.openConnection();
 InputStream in = new BufferedInputStream(urlConnection.getInputStream());

Upvotes: 1

Related Questions