FileDocCategorySizeDatePackage
Handler.javaAPI DocExample1286Sun Dec 12 10:55:40 GMT 2004com.macfaq.net.www.protocol.mailto

Handler

public class Handler extends URLStreamHandler

Fields Summary
Constructors Summary
Methods Summary
protected java.net.URLConnectionopenConnection(java.net.URL u)

    return new MailtoURLConnection(u);
  
public voidparseURL(java.net.URL u, java.lang.String spec, int start, int limit)

    
    String protocol    = u.getProtocol();
    String host        = "";
    int    port        = u.getPort();
    String file        = ""; // really username
    String userInfo    = null;
    String authority   = null;
    String query       = null;
    String fragmentID  = null;
  
    if( start < limit) {
      String address = spec.substring(start, limit);
      int atSign = address.indexOf('@");
      if (atSign >= 0) {
        host = address.substring(atSign+1);
        file = address.substring(0, atSign);
      }
    }
    
   // For Java 1.2 comment out this next line
   this.setURL(u, protocol, host, port, authority, 
                  userInfo, file, query, fragmentID );
    
    // In Java 1.2 and earlier uncomment the following line:
    // this.setURL(u, protocol, host, port, file, fragmentID );
          
  
protected java.lang.StringtoExternalForm(java.net.URL u)

  
    return "mailto:" + u.getFile() + "@" + u.getHost();;