FileDocCategorySizeDatePackage
MIMEHeadersViewer.javaAPI DocExample1057Sat Sep 09 20:52:52 BST 2000None

MIMEHeadersViewer

public class MIMEHeadersViewer 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[i]);
        URLConnection uc = u.openConnection();
        System.out.println("Content-type: " + uc.getContentType());
        System.out.println("Content-encoding: " 
         + uc.getContentEncoding());
        System.out.println("Date: " + new Date(uc.getDate()));
        System.out.println("Last modified: " 
         + new Date(uc.getLastModified()));
        System.out.println("Expiration date: " 
         + new Date(uc.getExpiration()));
        System.out.println("Content-length: " + uc.getContentLength());
      }  // end try
      catch (MalformedURLException e) {
        System.err.println(args[i] + " is not a URL I understand");
      }
      catch (IOException e) {
        System.err.println(e);
      }      
      System.out.println();       
    }  // end for