org.apache.uima.util

## Class UriUtils

- java.lang.Object
- - org.apache.uima.util.UriUtils

-     public class UriUtils
      extends Object

  Static methods supporting proper handling of URIs

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UriUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static URI` | `create(String s)` Create a URI from a String, with proper quoting.
    `static URI` | `quote(String s)` Create a URI from a string, with proper quoting.
    `static URI` | `quote(URL u)` Create a URI from a URL, with proper quoting.

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

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

- - ### Constructor Detail

    - #### UriUtils

          public UriUtils()

  - ### Method Detail

    - #### quote

          public static URI quote(String s)
                           throws URISyntaxException

      Create a URI from a string, with proper quoting. Already quoted things in the input string are not re-quoted. There are several cases: String has no characters needing quoting String has chars needing quoting, but no chars are currently quoted (e.g. %20) String has quoted (e.g. %20) characters but no other chars needing quoting String has quoted (e.g. %20) characters and chars needing quoting, not currently quoted -- this case will throw an exception
      Parameters:
        `s` - the string to quote
      Returns:
        URI with proper quoting
      Throws:
        `URISyntaxException` - passthru

    - #### quote

          public static URI quote(URL u)
                           throws URISyntaxException

      Create a URI from a URL, with proper quoting. Already quoted things in the input string are not re-quoted.
      Parameters:
        `u` - the input URL
      Returns:
        URI with proper quoting
      Throws:
        `URISyntaxException` - passthru

    - #### create

          public static URI create(String s)

      Create a URI from a String, with proper quoting. Already quoted things in the input string are not re-quoted. Mimic exception treatment of URI.create
      Parameters:
        `s` - the input string
      Returns:
        URI with proper quoting

Copyright © 2006–2018 The Apache Software Foundation. All rights reserved.