private URI canonicalize(String uriString) throws URISyntaxException {
  if (uriString == null) {
    uriString="local://0@localhost";
    return new URI(uriString);
  }
  URI u=new URI(uriString);
  if (u.isAbsolute()) {
    if (u.isOpaque()) {
      u=new URI(u.getScheme(),"//" + u.getSchemeSpecificPart(),u.getFragment());
    }
  }
 else {
    if (!uriString.startsWith("//")) {
      if (u.getFragment() == null) {
        u=new URI("//" + u.getSchemeSpecificPart());
      }
 else {
        u=new URI("//" + u.getSchemeSpecificPart() + "#"+ u.getFragment());
      }
    }
  }
  return u;
}

private URI canonicalize ( String uriString ) throws URISyntaxException { if ( uriString == null ) { uriString = "local://0@localhost" ; return new URI ( uriString ) ; } URI u = new URI ( uriString ) ; if ( u . isAbsolute ( ) ) { if ( u . isOpaque ( ) ) { u = new URI ( u . getScheme ( ) , "//" + u . getSchemeSpecificPart ( ) , u . getFragment ( ) ) ; } } else { if ( ! uriString . startsWith ( "//" ) ) { if ( u . getFragment ( ) == null ) { u = new URI ( "//" + u . getSchemeSpecificPart ( ) ) ; } else { u = new URI ( "//" + u . getSchemeSpecificPart ( ) + "#" + u . getFragment ( ) ) ; } } } return u ; }
creates a canonical representation of the uristring . this method performs certain translations depending on the type of uri generated by the string .
