org.eclipse.jetty.http

## Class HttpURI

- java.lang.Object
- - org.eclipse.jetty.http.HttpURI

- Direct Known Subclasses:
    EncodedHttpURI

      public class HttpURI
      extends Object

  Http URI. Parse a HTTP URI from a string or byte array. Given a URI `http://user@host:port/path/info;param?query#fragment` this class will split it into the following undecoded optional elements:
  - `getScheme()` - http:
  - `getAuthority()` - //name@host:port
  - `getHost()` - host
  - `getPort()` - port
  - `getPath()` - /path/info
  - `getParam()` - param
  - `getQuery()` - query
  - `getFragment()` - fragment

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpURI()`
    `HttpURI(boolean parsePartialAuth)`
    `HttpURI(byte[] raw, int offset, int length)`
    `HttpURI(String raw)`
    `HttpURI(URI uri)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `void` | `decodeQueryTo(MultiMap parameters)`
    `void` | `decodeQueryTo(MultiMap parameters, String encoding)`
    `String` | `getAuthority()`
    `String` | `getCompletePath()`
    `String` | `getDecodedPath()`
    `String` | `getFragment()`
    `String` | `getHost()`
    `String` | `getParam()`
    `String` | `getPath()`
    `String` | `getPathAndParam()`
    `int` | `getPort()`
    `String` | `getQuery()`
    `String` | `getQuery(String encoding)`
    `String` | `getScheme()`
    `boolean` | `hasQuery()`
    `void` | `parse(byte[] raw, int offset, int length)`
    `void` | `parse(String raw)`
    `void` | `parseConnect(byte[] raw, int offset, int length)`
    `String` | `toString()`
    `void` | `writeTo(Utf8StringBuilder buf)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### HttpURI

          public HttpURI()

    - #### HttpURI

          public HttpURI(boolean parsePartialAuth)

      Parameters:
        `parsePartialAuth` - If True, parse auth without prior scheme, else treat all URIs starting with / as paths

    - #### HttpURI

          public HttpURI(String raw)

    - #### HttpURI

          public HttpURI(byte[] raw,
                 int offset,
                 int length)

    - #### HttpURI

          public HttpURI(URI uri)

  - ### Method Detail

    - #### parse

          public void parse(String raw)

    - #### parse

          public void parse(byte[] raw,
                   int offset,
                   int length)

    - #### parseConnect

          public void parseConnect(byte[] raw,
                          int offset,
                          int length)

    - #### getScheme

          public String getScheme()

    - #### getAuthority

          public String getAuthority()

    - #### getHost

          public String getHost()

    - #### getPort

          public int getPort()

    - #### getPath

          public String getPath()

    - #### getDecodedPath

          public String getDecodedPath()

    - #### getPathAndParam

          public String getPathAndParam()

    - #### getCompletePath

          public String getCompletePath()

    - #### getParam

          public String getParam()

    - #### getQuery

          public String getQuery()

    - #### getQuery

          public String getQuery(String encoding)

    - #### hasQuery

          public boolean hasQuery()

    - #### getFragment

          public String getFragment()

    - #### decodeQueryTo

          public void decodeQueryTo(MultiMap parameters)

    - #### decodeQueryTo

          public void decodeQueryTo(MultiMap parameters,
                           String encoding)
                             throws UnsupportedEncodingException

      Throws:
        `UnsupportedEncodingException`

    - #### clear

          public void clear()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### writeTo

          public void writeTo(Utf8StringBuilder buf)

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.