FileDocCategorySizeDatePackage
getURLParts.javaAPI DocExample745Thu Apr 03 15:15:16 BST 1997None

getURLParts

public class getURLParts extends Object

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


    for (int i = 0; i < args.length; i++) {
      try {
        URL u = new URL(args[0]);
        System.out.println("The URL is " + u);
        System.out.println("The protocol part is " + u.getProtocol());
        System.out.println("The host part is " + u.getHost());
        System.out.println("The port part is " + u.getPort());
        System.out.println("The file part is " + u.getFile());
        System.out.println("The ref part is " + u.getRef());
      }  // end try
      catch (MalformedURLException e) {
        System.err.println(args[0] + "is not a URL I understand.");
      }
    }  // end for