Top Description Fields Constructors Methods
sun.net.www

public final Class ParseUtil

extends Object
Class Inheritance
Imports
java.io.File, java.net.MalformedURLException, .URI, .URISyntaxException, .URL, java.nio.ByteBuffer, .CharBuffer, java.nio.charset.CharacterCodingException, .CharsetDecoder, .CharsetEncoder, .CoderResult, .CodingErrorAction, java.util.HexFormat, sun.nio.cs.UTF_8

A class that contains useful routines common to sun.net.www
Author
Mike McCloskey

Field Summary

Modifier and TypeField and Description
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final HexFormat
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
appendAuthority(StringBuilder sb, String authority, String userInfo, String host, int port)

private static void
private static void
private static void
private static void
appendSchemeSpecificPart(StringBuilder sb, String opaquePart, String authority, String userInfo, String host, int port, String path, String query)

private static void
checkPath(String s, String scheme, String path)

private static URI
createURI(String scheme, String authority, String path, String query, String fragment)

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.

public static String
encodePath(String path)

Constructs an encoded version of the specified path string suitable for use in the construction of a URL.

public static String
encodePath(String path, boolean flag)

private static String
encodePath(String path, int index, char sep)

private static int
escape(char[] cc, char c, int index)

Appends the URL escape sequence for the specified char to the specified character array.

public static URL
private static int
private static boolean
isEscaped(String s, int pos)

private static boolean
match(char c, long lowMask, long highMask)

private static String
quote(String s, long lowMask, long highMask)

private static String
toString(String scheme, String opaquePart, String authority, String userInfo, String host, int port, String path, String query, String fragment)

public static URI
toURI(URL url)

private static byte
unescape(String s, int i)

Un-escape and return the character at position i in string s.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

H_ALPHAback to summary
private static final long H_ALPHA
H_ALPHANUMback to summary
private static final long H_ALPHANUM
H_DASHback to summary
private static final long H_DASH
H_DIGITback to summary
private static final long H_DIGIT
H_ENCODEDback to summary
private static final long H_ENCODED
H_ESCAPEDback to summary
private static final long H_ESCAPED
H_HEXback to summary
private static final long H_HEX
H_LOWALPHAback to summary
private static final long H_LOWALPHA
H_MARKback to summary
private static final long H_MARK
H_PATHback to summary
private static final long H_PATH
H_PCHARback to summary
private static final long H_PCHAR
H_REG_NAMEback to summary
private static final long H_REG_NAME
H_RESERVEDback to summary
private static final long H_RESERVED
H_SERVERback to summary
private static final long H_SERVER
H_UNRESERVEDback to summary
private static final long H_UNRESERVED
H_UPALPHAback to summary
private static final long H_UPALPHA
H_URICback to summary
private static final long H_URIC
H_USERINFOback to summary
private static final long H_USERINFO
HEX_UPPERCASEback to summary
private static final HexFormat HEX_UPPERCASE
L_ALPHAback to summary
private static final long L_ALPHA
L_ALPHANUMback to summary
private static final long L_ALPHANUM
L_DASHback to summary
private static final long L_DASH
L_DIGITback to summary
private static final long L_DIGIT
L_ENCODEDback to summary
private static final long L_ENCODED
L_ESCAPEDback to summary
private static final long L_ESCAPED
L_HEXback to summary
private static final long L_HEX
L_LOWALPHAback to summary
private static final long L_LOWALPHA
L_MARKback to summary
private static final long L_MARK
L_PATHback to summary
private static final long L_PATH
L_PCHARback to summary
private static final long L_PCHAR
L_REG_NAMEback to summary
private static final long L_REG_NAME
L_RESERVEDback to summary
private static final long L_RESERVED
L_SERVERback to summary
private static final long L_SERVER
L_UNRESERVEDback to summary
private static final long L_UNRESERVED
L_UPALPHAback to summary
private static final long L_UPALPHA
L_URICback to summary
private static final long L_URIC
L_USERINFOback to summary
private static final long L_USERINFO

Constructor Detail

ParseUtilback to summary
private ParseUtil()

Method Detail

appendAuthorityback to summary
private static void appendAuthority(StringBuilder sb, String authority, String userInfo, String host, int port)
appendEncodedback to summary
private static void appendEncoded(CharsetEncoder encoder, StringBuilder sb, char c)
appendEscapeback to summary
private static void appendEscape(StringBuilder sb, byte b)
appendFragmentback to summary
private static void appendFragment(StringBuilder sb, String fragment)
appendSchemeSpecificPartback to summary
private static void appendSchemeSpecificPart(StringBuilder sb, String opaquePart, String authority, String userInfo, String host, int port, String path, String query)
checkPathback to summary
private static void checkPath(String s, String scheme, String path) throws URISyntaxException
createURIback to summary
private static URI createURI(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException
decodeback to summary
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.

encodePathback to summary
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.

encodePathback to summary
public static String encodePath(String path, boolean flag)
encodePathback to summary
private static String encodePath(String path, int index, char sep)
escapeback to summary
private static int escape(char[] cc, char c, int index)

Appends the URL escape sequence for the specified char to the specified character array.

fileToEncodedURLback to summary
public static URL fileToEncodedURL(File file) throws MalformedURLException
firstEncodeIndexback to summary
private static int firstEncodeIndex(String path)
isEscapedback to summary
private static boolean isEscaped(String s, int pos)
matchback to summary
private static boolean match(char c, long lowMask, long highMask)
quoteback to summary
private static String quote(String s, long lowMask, long highMask)
toStringback to summary
private static String toString(String scheme, String opaquePart, String authority, String userInfo, String host, int port, String path, String query, String fragment)
toURIback to summary
public static URI toURI(URL url)
unescapeback to summary
private static byte unescape(String s, int i)

Un-escape and return the character at position i in string s.