You can follow this steps: Create your proper URL instance: URL target=new URL(the_file_address); Make an URLConnection urlc=New URLConnection(myURL); Get the text file as a stream you can read/save/etc... with urlc.getInputStream(); You can also get the same InputStream from your URL instance with openStream(). -HTH
marco tognoni
Greenhorn
Posts: 17
posted 16 years ago
I do what you told me, but it goes error: java.net.NoRouteToHostException: No route to host: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148) at java.net.Socket.connect(Socket.java:425) at java.net.Socket.connect(Socket.java:375)
You get this error messages because you are doing something wrong, take a look at how Rene uses the URL, URLConnection classes in the example above. Check you write the address properly (http://...)
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database