code: public static String createURI(final String scheme, final String host, int port, final String path,
              final String query, final String fragment) {
          StringBuilder buffer = new StringBuilder(Parameters.SMALL_BUFFER_SIZE);
          if (host != null) {
              if (scheme != null) {
                  buffer.append(scheme);
                  buffer.append("://");
              }
              buffer.append(host);
              if (port > 0) {
                  buffer.append(':');
                  buffer.append(port);
              }
          }
          if (path == null || !path.startsWith("/")) {
              buffer.append('/');
          }
          if (path != null) {
              buffer.append(path);
          }
          if (query != null) {
              buffer.append('?');
              buffer.append(query);
          }
          if (fragment != null) {
              buffer.append('#');
              buffer.append(fragment);
          }
          return buffer.toString();
      }
docs: Creates an URI as a String.
  
  @param scheme
  the scheme
  @param host
  the host
  @param port
  the port
  @param path
  the path
  @param query
  the query
  @param fragment
  the fragment
  @return the uri