public final class

URLUtil

extends Object
java.lang.Object
   ↳ com.tencent.smtt.sdk.URLUtil

Summary

Public Constructors
URLUtil()
Public Methods
static String composeSearchUrl(String inQuery, String template, String queryPlaceHolder)
static byte[] decode(byte[] url)
final static String guessFileName(String url, String contentDisposition, String mimeType)
Guesses canonical filename that a download would have, using the URL and contentDisposition.
static String guessUrl(String inUrl)
Cleans up (if possible) user-entered web addresses
static boolean isAboutUrl(String url)
static boolean isAssetUrl(String url)
static boolean isContentUrl(String url)
static boolean isCookielessProxyUrl(String url)
This method is deprecated. Cookieless proxy is no longer supported.
static boolean isDataUrl(String url)
static boolean isFileUrl(String url)
static boolean isHttpUrl(String url)
static boolean isHttpsUrl(String url)
static boolean isJavaScriptUrl(String url)
static boolean isNetworkUrl(String url)
static boolean isValidUrl(String url)
static String stripAnchor(String url)
Strips the url of the anchor.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public URLUtil ()

Public Methods

public static String composeSearchUrl (String inQuery, String template, String queryPlaceHolder)

public static byte[] decode (byte[] url)

Throws
IllegalArgumentException

public static final String guessFileName (String url, String contentDisposition, String mimeType)

Guesses canonical filename that a download would have, using the URL and contentDisposition. File extension, if not defined, is added based on the mimetype

Parameters
url Url to the content
contentDisposition Content-Disposition HTTP header or null
mimeType Mime-type of the content or null
Returns
  • suggested filename

public static String guessUrl (String inUrl)

Cleans up (if possible) user-entered web addresses

public static boolean isAboutUrl (String url)

Returns
  • True iff the url is an about: url.

public static boolean isAssetUrl (String url)

Returns
  • True iff the url is an asset file.

public static boolean isContentUrl (String url)

Returns
  • True iff the url is a content: url.

public static boolean isCookielessProxyUrl (String url)

This method is deprecated.
Cookieless proxy is no longer supported.

Returns
  • True iff the url is a proxy url to allow cookieless network requests from a file url.

public static boolean isDataUrl (String url)

Returns
  • True iff the url is a data: url.

public static boolean isFileUrl (String url)

Returns
  • True iff the url is a local file.

public static boolean isHttpUrl (String url)

Returns
  • True iff the url is an http: url.

public static boolean isHttpsUrl (String url)

Returns
  • True iff the url is an https: url.

public static boolean isJavaScriptUrl (String url)

Returns
  • True iff the url is a javascript: url.

public static boolean isNetworkUrl (String url)

Returns
  • True iff the url is a network url.

public static boolean isValidUrl (String url)

Returns
  • True iff the url is valid.

public static String stripAnchor (String url)

Strips the url of the anchor.