FileDocCategorySizeDatePackage
WebCat.javaAPI DocExample854Sun Mar 28 19:06:06 BST 1999None

WebCat

public class WebCat extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


    if (args.length == 0) {
      System.err.println("Usage: java WebCat url1 url2 ...");
      return;
    }

    for (int i = 0; i < args.length; i++) {
      if (i > 0 && i < args.length) {
        System.out.println();
        System.out.println("----------------------");
        System.out.println();
      }
      System.out.println(args[i] + ":");
      try {
        URL u = new URL(args[i]);
        URLConnection uc = u.openConnection();
        uc.connect();
        InputStream in = uc.getInputStream();
       StreamCopier.copy(in, System.out);
        in.close();
      }
      catch (IOException e) {
        System.err.println(e);
      }      
    } // end for