public final class URLUtility extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
changeLanguageForUrl(String url)
Generates a new URL to the API using the fallback locale
FALLBACK_LOCALE. |
static String |
changeLanguageForUrl(String url,
Locale locale)
Generates a new URL to the API using the specified locale.
|
static String |
changeLanguageForUrl(String url,
String language)
Generates a new URL to the API by replacing the current language tag in the URL with the
specified language tag.
|
public static String changeLanguageForUrl(String url)
FALLBACK_LOCALE.
See changeLanguageForUrl(String, String) for implementation details.url - the URL to editpublic static String changeLanguageForUrl(String url, Locale locale)
changeLanguageForUrl(String, String) for implementation details.url - the URL to editlocale - the locale to usepublic static String changeLanguageForUrl(String url, String language)
Generates a new URL to the API by replacing the current language tag in the URL with the specified language tag.
This method performs these steps to figure out what needs to be replaced:
Due to speed efficiency, this method does not perform any validity check on the specified URL. Calling this method without a valid URL for the API may (and probably will) result in unexpected behavior.
url - the URL to editlanguage - the language to useCopyright © 2016. All rights reserved.