diff -urN /home/topic/kaffe/libraries/javalib/java/net/URI.java libraries/javalib/java/net/URI.java
--- /home/topic/kaffe/libraries/javalib/java/net/URI.java	2002-11-11 13:01:53.000000000 +0100
+++ libraries/javalib/java/net/URI.java	2002-11-29 01:17:46.000000000 +0100
@@ -41,6 +41,8 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * @author Michael Koch <konqueror@gmx.de>
@@ -51,7 +53,41 @@
 {
   static final long serialVersionUID = -6052424284110960213L;
 
-  String string;
+  /**
+   * Regular expression for parsing URIs.
+   *
+   * Taken from RFC 2396, Appendix B.
+   * This expression doesn't parse IPv6 addresses.
+   */
+  private static final String URI_REGEXP =
+    "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?";
+
+  /**
+   * Index of scheme component in parsed URI.
+   */
+  private static final int SCHEME_GROUP = 2;
+
+  /**
+   * Index of authority component in parsed URI.
+   */
+  private static final int AUTHORITY_GROUP = 4;
+
+  /**
+   * Index of path component in parsed URI.
+   */
+  private static final int PATH_GROUP = 5;
+
+  /**
+   * Index of query component in parsed URI.
+   */
+  private static final int QUERY_GROUP = 7;
+
+  /**
+   * Index of fragment component in parsed URI.
+   */
+  private static final int FRAGMENT_GROUP = 9;
+
+  String string;  
   private String scheme;
   private String schemeSpecificPart;
   private String authority;
@@ -72,11 +108,115 @@
   {
   }
 
+  private static String getURIGroup (Matcher match, int group) {
+    String matched = match.group(group);
+    return matched.length() == 0 ? null : matched;
+  }
+
+  /**
+   * Sets fields of this URI by parsing the given string.
+   *
+   * @param str The string to parse
+   *
+   * @exception URISyntaxException If the given string violates RFC 2396
+   */
   private void parseURI (String str)
     throws URISyntaxException
   {
+    Pattern pattern = Pattern.compile(URI_REGEXP);
+    Matcher matcher = pattern.matcher(str);
+    if (matcher.matches()) {
+      scheme = getURIGroup(matcher, SCHEME_GROUP);
+      authority = getURIGroup(matcher, AUTHORITY_GROUP);
+      path = getURIGroup(matcher, PATH_GROUP);
+      query = getURIGroup(matcher, QUERY_GROUP);
+      fragment = getURIGroup(matcher, FRAGMENT_GROUP);
+    }
+    else {
+      throw new URISyntaxException(str, "doesn't match URI regular expression");
+    }
+  }
+
+  /**
+   * Quote characters illegal in URIs in given string.
+   *
+   * Replace illegal characters by encoding their UTF-8
+   * representation as "%" + hex code for each resulting
+   * UTF-8 character.
+   *
+   * @param str The string to quote
+   * 
+   * @return The quoted string.
+   */
+  private static String quote (String str) {
+    // FIXME: unimplemented.
+    return str;
+  }
+
+  /**
+   * Quote characters illegal in URI authorities in given string.
+   *
+   * Replace illegal characters by encoding their UTF-8
+   * representation as "%" + hex code for each resulting
+   * UTF-8 character.
+   *
+   * @param str The string to quote
+   * 
+   * @return The quoted string.
+   */
+  private static String quoteAuthority (String str) {
+    // FIXME: unimplemented.
+    return str;
+  }
+
+  /**
+   * Quote characters illegal in URI hosts in given string.
+   *
+   * Replace illegal characters by encoding their UTF-8
+   * representation as "%" + hex code for each resulting
+   * UTF-8 character.
+   *
+   * @param str The string to quote
+   * 
+   * @return The quoted string.
+   */
+  private static String quoteHost (String str) {
+    // FIXME: unimplemented.
+    return str;
   }
-  
+
+  /**
+   * Quote characters illegal in URI paths in given string.
+   *
+   * Replace illegal characters by encoding their UTF-8
+   * representation as "%" + hex code for each resulting
+   * UTF-8 character.
+   *
+   * @param str The string to quote
+   * 
+   * @return The quoted string.
+   */
+  private static String quotePath (String str) {
+    // FIXME: unimplemented.
+    return str;
+  }
+
+  /**
+   * Quote characters illegal in URI user infos in given string.
+   *
+   * Replace illegal characters by encoding their UTF-8
+   * representation as "%" + hex code for each resulting
+   * UTF-8 character.
+   *
+   * @param str The string to quote
+   * 
+   * @return The quoted string.
+   */
+  private static String quoteUserInfo (String str) {
+    // FIXME: unimplemented.
+    return str;
+  }
+
   /**
    * Creates an URI from the given string
    *
@@ -88,6 +228,7 @@
   public URI (String str)
     throws URISyntaxException
   {
+    parseURI(str);
   }
  
   /**
@@ -107,6 +248,17 @@
 	     String path, String query, String fragment)
     throws URISyntaxException
   {
+    this(""
+	 + (scheme == null ? "" : scheme + ":" )
+	 + (userInfo == null && host == null && port == -1 ? "" : "//")
+	 + (userInfo == null ? "" : quoteUserInfo(userInfo) + "@")
+	 + (host == null ? "" : quoteHost(host))
+	 + (port == -1 ? "" : ":" + String.valueOf(port))
+	 + (path == null ? "" : quotePath(path))
+	 + (query == null ? "" : "?" + quote(query))
+	 + (fragment == null ? "" : "#" + quote(fragment)));
+
+    parseServerAuthority();
   }
 
   /**
@@ -116,7 +268,7 @@
    * @param authority The authority
    * @param path The apth
    * @param query The query
-   * @param fragment The fragmen
+   * @param fragment The fragment
    *
    * @exception URISyntaxException If the given string violates RFC 2396
    */
@@ -124,6 +276,12 @@
 	     String fragment)
     throws URISyntaxException
   {
+    this(""
+	 + (scheme == null ? "" : scheme + ":")
+	 + (authority == null ? "" : "//" + quoteAuthority(authority))
+	 + (path == null ? "" : quotePath(path))
+	 + (query == null ? "" : "?" + quote(query))
+	 + (fragment == null ? "" : "#" + quote(fragment)));
   }
 
   /**
@@ -139,6 +297,7 @@
   public URI (String scheme, String host, String path, String fragment)
     throws URISyntaxException
   {
+    this(scheme, null, host, -1, path, null, fragment);
   }
 
   /**
@@ -153,6 +312,10 @@
   public URI (String scheme, String ssp, String fragment)
     throws URISyntaxException
   {
+    this(""
+	 + (scheme == null ? "" : scheme + ":")
+	 + (ssp == null ? "" : quote(ssp))
+	 + (fragment == null ? "" : "#" + quote(fragment)));
   }
 
   /**
@@ -164,9 +327,15 @@
    * @exception NullPointerException If str is null
    */
   public static URI create (String str)
-    throws IllegalArgumentException, URISyntaxException
+    throws IllegalArgumentException
   {
-    return null;
+    try {
+      return new URI(str);
+    }
+    catch(URISyntaxException e) {
+      throw (IllegalArgumentException)
+	new IllegalArgumentException().initCause(e);
+    }
   }
 
   /**
@@ -420,7 +589,12 @@
    */
   public String toString ()
   {
-    return "";
+    return ""
+      + (getScheme() == null ? "" : getScheme() + ":")
+      + (getRawAuthority() == null ? "" : "//" + getRawAuthority())
+      + (getRawPath() == null ? "" : getRawPath())
+      + (getRawQuery() == null ? "" : "?" + getRawQuery())
+      + (getRawFragment() == null ? "" : "#" + getRawFragment());
   }
 
   /**
