public final class URL extends Object
com.google.gwt.http.HTTP
.
Modifier and Type | Method and Description |
---|---|
static String |
decode(String encodedURL)
Returns a string where all URL escape sequences have been converted back to
their original character representations.
|
static String |
decodeComponent(String encodedURLComponent)
Deprecated.
|
static String |
decodeComponent(String encodedURLComponent,
boolean fromQueryString)
Deprecated.
|
static String |
decodePathSegment(String encodedURLComponent)
Returns a string where all URL component escape sequences have been
converted back to their original character representations.
|
static String |
decodeQueryString(String encodedURLComponent)
Returns a string where all URL component escape sequences have been
converted back to their original character representations.
|
static String |
encode(String decodedURL)
Returns a string where all characters that are not valid for a complete URL
have been escaped.
|
static String |
encodeComponent(String decodedURLComponent)
Deprecated.
|
static String |
encodeComponent(String decodedURLComponent,
boolean queryStringSpaces)
Deprecated.
|
static String |
encodePathSegment(String decodedURLComponent)
Returns a string where all characters that are not valid for a URL
component have been escaped.
|
static String |
encodeQueryString(String decodedURLComponent)
Returns a string where all characters that are not valid for a URL
component have been escaped.
|
public static String decode(String encodedURL)
encodedURL
- string containing encoded URL encoded sequencesNullPointerException
- if encodedURL is null
@Deprecated public static String decodeComponent(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
sequencesNullPointerException
- if encodedURLComponent is null
@Deprecated public static String decodeComponent(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.NullPointerException
- if encodedURLComponent is null
public static String decodePathSegment(String encodedURLComponent)
encodedURLComponent
- string containing encoded URL component
sequencesNullPointerException
- if encodedURLComponent is null
public static String decodeQueryString(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
sequencesNullPointerException
- if encodedURLComponent is null
public static String encode(String decodedURL)
The following character sets are not escaped by this method:
- _ . ! ~ * ' ( )
; / ? : & = + $ , #
decodedURL
- a string containing URL characters that may require
encodingNullPointerException
- if decodedURL is null
@Deprecated public static String encodeComponent(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 charactersNullPointerException
- if decodedURLComponent is null
@Deprecated public static String encodeComponent(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.NullPointerException
- if decodedURLComponent is null
public static String encodePathSegment(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 charactersNullPointerException
- if decodedURLComponent is null
public static String encodeQueryString(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 charactersNullPointerException
- if decodedURLComponent is null
Copyright © 2018. All rights reserved.