import java.net.*;
import java.io.*;

/** Retrieves and prints the resource at the specified URL. */
public class GetURL {

  public static void main (String[] args) {

	if (args.length != 1) {
		System.out.println("Usage: "+GetURL.class.getName()+" <url>");
		System.exit(1);
	}
  
    try {
      String thisLine;
      URL u = new URL(args[0]);
      DataInputStream theHTML = new DataInputStream(u.openStream());
      while ((thisLine = theHTML.readLine()) != null) {
        System.out.println(thisLine);
      }
    }
    catch (MalformedURLException e) {
      System.err.println(e);
    }
    catch (IOException e) {
      System.err.println(e);
    }
    
  }

}
