Package com.sun.ts.lib.util.sec.net.www

# Class ParseUtil

java.lang.Object
com.sun.ts.lib.util.sec.net.www.ParseUtil

public class ParseUtil extends Object
A class that contains useful routines common to sun.net.www

Author:
  Mike McCloskey

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParseUtil()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `canonizeString(String file)`
  Returns a canonical version of the specified string.
  `static String`
  `decode(String s)`
  Returns a new String constructed from the specified String by replacing the URL escape sequences and UTF8 encoding with the characters they represent.
  `static String`
  `encodePath(String path)`
  Constructs an encoded version of the specified path string suitable for use in the construction of a URL.
  `static String`
  `encodePath(String path, boolean flag)`
  `static URL`
  `fileToEncodedURL(File file)`
  `static URI`
  `toURI(URL url)`

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

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

- ## Constructor Details

  - ### ParseUtil

    public ParseUtil()

- ## Method Details

  - ### encodePath

    public static String encodePath(String path)
    Constructs an encoded version of the specified path string suitable for use in the construction of a URL. A path separator is replaced by a forward slash. The string is UTF8 encoded. The % escape sequence is used for characters that are above 0x7F or those defined in RFC2396 as reserved or excluded in the path component of a URL.

  - ### encodePath

    public static String encodePath(String path, boolean flag)

  - ### decode

    public static String decode(String s)
    Returns a new String constructed from the specified String by replacing the URL escape sequences and UTF8 encoding with the characters they represent.

  - ### canonizeString

    public String canonizeString(String file)
    Returns a canonical version of the specified string.

  - ### fileToEncodedURL

    public static URL fileToEncodedURL(File file) throws MalformedURLException
    Throws:
      `MalformedURLException`

  - ### toURI

    public static URI toURI(URL url)