FileDocCategorySizeDatePackage
URLTimeClient.javaAPI DocExample609Sun Dec 12 10:55:54 GMT 2004None

URLTimeClient

public class URLTimeClient extends Object

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

  
    System.setProperty("java.protocol.handler.pkgs", 
     "com.macfaq.net.www.protocol");
  
    try {
      // You can replace this with your own time server
      URL u = new URL("time://tock.usno.navy.mil/");
      Class[] types = {String.class, Date.class, 
       Calendar.class, Long.class};
      Object o = u.getContent(types);
      System.out.println(o);
    }
    catch (IOException ex) {
     // Let's see what went wrong
     ex.printStackTrace(); 
    }