public final class URL
extends java.lang.Object
com.google.gwt.http.HTTP.
<module> <!-- other inherited modules, such as com.google.gwt.user.User --> <inherits name="com.google.gwt.http.HTTP"/> <!-- additional module settings --> </module>
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decode(java.lang.String encodedURL)
Returns a string where all URL escape sequences have been converted back to
their original character representations.
|
static java.lang.String |
decodeComponent(java.lang.String encodedURLComponent)
Deprecated.
|
static java.lang.String |
decodeComponent(java.lang.String encodedURLComponent,
boolean fromQueryString)
Deprecated.
|
static java.lang.String |
decodePathSegment(java.lang.String encodedURLComponent)
Returns a string where all URL component escape sequences have been
converted back to their original character representations.
|
static java.lang.String |
decodeQueryString(java.lang.String encodedURLComponent)
Returns a string where all URL component escape sequences have been
converted back to their original character representations.
|
static java.lang.String |
encode(java.lang.String decodedURL)
Returns a string where all characters that are not valid for a complete URL
have been escaped.
|
static java.lang.String |
encodeComponent(java.lang.String decodedURLComponent)
Deprecated.
|
static java.lang.String |
encodeComponent(java.lang.String decodedURLComponent,
boolean queryStringSpaces)
Deprecated.
|
static java.lang.String |
encodePathSegment(java.lang.String decodedURLComponent)
Returns a string where all characters that are not valid for a URL
component have been escaped.
|
static java.lang.String |
encodeQueryString(java.lang.String decodedURLComponent)
Returns a string where all characters that are not valid for a URL
component have been escaped.
|
public static java.lang.String decode(java.lang.String encodedURL)
encodedURL - string containing encoded URL encoded sequencesjava.lang.NullPointerException - if encodedURL is null@Deprecated public static java.lang.String decodeComponent(java.lang.String encodedURLComponent)
decodeQueryString(String)Note: this method will convert the space character escape short form, '+', into a space. It should therefore only be used for query-string parts.
encodedURLComponent - string containing encoded URL component
sequencesjava.lang.NullPointerException - if encodedURLComponent is null@Deprecated
public static java.lang.String decodeComponent(java.lang.String encodedURLComponent,
boolean fromQueryString)
decodeQueryString(String),
decodePathSegment(String)encodedURLComponent - string containing encoded URL component
sequencesfromQueryString - if true, +'s will be turned into
spaces, otherwise they'll be kept as-is.java.lang.NullPointerException - if encodedURLComponent is nullpublic static java.lang.String decodePathSegment(java.lang.String encodedURLComponent)
encodedURLComponent - string containing encoded URL component
sequencesjava.lang.NullPointerException - if encodedURLComponent is nullpublic static java.lang.String decodeQueryString(java.lang.String encodedURLComponent)
Note: this method will convert the space character escape short form, '+', into a space. It should therefore only be used for query-string parts.
encodedURLComponent - string containing encoded URL component
sequencesjava.lang.NullPointerException - if encodedURLComponent is nullpublic static java.lang.String encode(java.lang.String decodedURL)
The following character sets are not escaped by this method:
- _ . ! ~ * ' ( )
; / ? : & = + $ , #
decodedURL - a string containing URL characters that may require
encodingjava.lang.NullPointerException - if decodedURL is null@Deprecated public static java.lang.String encodeComponent(java.lang.String decodedURLComponent)
encodeQueryString(String)Note: this method will convert any the space character into its escape short form, '+' rather than %20. It should therefore only be used for query-string parts.
The following character sets are not escaped by this method:
- _ . ! ~ * ' ( )
Notice that this method does encode the URL component delimiter characters:
; / ? : & = + $ , #
decodedURLComponent - a string containing invalid URL charactersjava.lang.NullPointerException - if decodedURLComponent is null@Deprecated
public static java.lang.String encodeComponent(java.lang.String decodedURLComponent,
boolean queryStringSpaces)
encodeQueryString(String),
encodePathSegment(String)The following character sets are not escaped by this method:
- _ . ! ~ * ' ( )
Notice that this method does encode the URL component delimiter characters:
; / ? : & = + $ , #
decodedURLComponent - a string containing invalid URL charactersqueryStringSpaces - if true, spaces will be encoded as
+'s.java.lang.NullPointerException - if decodedURLComponent is nullpublic static java.lang.String encodePathSegment(java.lang.String decodedURLComponent)
The following character sets are not escaped by this method:
- _ . ! ~ * ' ( )
Notice that this method does encode the URL component delimiter characters:
; / ? : & = + $ , #
decodedURLComponent - a string containing invalid URL charactersjava.lang.NullPointerException - if decodedURLComponent is nullpublic static java.lang.String encodeQueryString(java.lang.String decodedURLComponent)
Note: this method will convert any the space character into its escape short form, '+' rather than %20. It should therefore only be used for query-string parts.
The following character sets are not escaped by this method:
- _ . ! ~ * ' ( )
Notice that this method does encode the URL component delimiter characters:
; / ? : & = + $ , #
decodedURLComponent - a string containing invalid URL charactersjava.lang.NullPointerException - if decodedURLComponent is null