Posted By

angusdev on 10/21/09


Tagged

java


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

gzpeva
adkatrit


Shortest Java program to do wget


 / Published in: Java
 

  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. public class wget {
  5. public static void main(String[] args) throws Exception {
  6. String s;
  7. BufferedReader r = new BufferedReader(new InputStreamReader(new URL(args[0]).openStream()));
  8. while ((s = r.readLine()) != null) {
  9. System.out.println(s);
  10. }
  11. }
  12. }

Report this snippet  

You need to login to post a comment.