FileDocCategorySizeDatePackage
viewsource.javaAPI DocExample963Thu Apr 03 15:16:06 BST 1997None

viewsource

public class viewsource extends Object

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


    String thisLine;
    URL u;

    if  (args.length > 0) {

      //Open the URL for reading
      try {
        u = new URL(args[0]);
        // now turn the URL into a DataInputStream
        try {
          DataInputStream theHTML = new DataInputStream(u.openStream());

          try {
            while ((thisLine = theHTML.readLine()) != null) {
              System.out.println(thisLine);
            } // while loop ends here
          }  // end try
          catch (Exception e) {
            System.err.println(e);
          }
        } // end try
        catch (Exception e) {
          System.err.println(e);
        }

      } // end try
      catch (MalformedURLException e) {
        System.err.println(args[0] + " is not a parseable URL");
        System.err.println(e);
      }
    } //  end if