public URI(String scheme,String authority,String path,String query,String fragment) throws URISyntaxException {
  if (scheme != null && path != null && !path.isEmpty() && path.charAt(0) != '/') {
    throw new URISyntaxException(path,"Relative path");
  }
  StringBuilder uri=new StringBuilder();
  if (scheme != null) {
    uri.append(scheme);
    uri.append(':');
  }
  if (authority != null) {
    uri.append("//");
    AUTHORITY_ENCODER.appendEncoded(uri,authority);
  }
  if (path != null) {
    PATH_ENCODER.appendEncoded(uri,path);
  }
  if (query != null) {
    uri.append('?');
    ALL_LEGAL_ENCODER.appendEncoded(uri,query);
  }
  if (fragment != null) {
    uri.append('#');
    ALL_LEGAL_ENCODER.appendEncoded(uri,fragment);
  }
  parseURI(uri.toString(),false);
}

public URI ( String scheme , String authority , String path , String query , String fragment ) throws URISyntaxException { if ( scheme != null && path != null && ! path . isEmpty ( ) && path . charAt ( 0 ) != '/' ) { throw new URISyntaxException ( path , "Relative path" ) ; } StringBuilder uri = new StringBuilder ( ) ; if ( scheme != null ) { uri . append ( scheme ) ; uri . append ( ':' ) ; } if ( authority != null ) { uri . append ( "//" ) ; AUTHORITY_ENCODER . appendEncoded ( uri , authority ) ; } if ( path != null ) { PATH_ENCODER . appendEncoded ( uri , path ) ; } if ( query != null ) { uri . append ( '?' ) ; ALL_LEGAL_ENCODER . appendEncoded ( uri , query ) ; } if ( fragment != null ) { uri . append ( '#' ) ; ALL_LEGAL_ENCODER . appendEncoded ( uri , fragment ) ; } parseURI ( uri . toString ( ) , false ) ; }
creates a new uri instance of the given unencoded component parts .
