android.webkit
Class URLUtil
java.lang.Object
android.webkit.URLUtil
public final class URLUtil
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ASSET_BASE
static final String ASSET_BASE
- See Also:
- Constant Field Values
FILE_BASE
static final String FILE_BASE
- See Also:
- Constant Field Values
PROXY_BASE
static final String PROXY_BASE
- See Also:
- Constant Field Values
URLUtil
public URLUtil()
guessUrl
public static String guessUrl(String inUrl)
- Cleans up (if possible) user-entered web addresses
composeSearchUrl
public static String composeSearchUrl(String inQuery,
String template,
String queryPlaceHolder)
decode
public static byte[] decode(byte[] url)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
isAssetUrl
public static boolean isAssetUrl(String url)
- Returns:
- True iff the url is an asset file.
isCookielessProxyUrl
public static boolean isCookielessProxyUrl(String url)
- Returns:
- True iff the url is an proxy url to allow cookieless network
requests from a file url.
isFileUrl
public static boolean isFileUrl(String url)
- Returns:
- True iff the url is a local file.
isAboutUrl
public static boolean isAboutUrl(String url)
- Returns:
- True iff the url is an about: url.
isDataUrl
public static boolean isDataUrl(String url)
- Returns:
- True iff the url is a data: url.
isJavaScriptUrl
public static boolean isJavaScriptUrl(String url)
- Returns:
- True iff the url is a javascript: url.
isHttpUrl
public static boolean isHttpUrl(String url)
- Returns:
- True iff the url is an http: url.
isHttpsUrl
public static boolean isHttpsUrl(String url)
- Returns:
- True iff the url is an https: url.
isNetworkUrl
public static boolean isNetworkUrl(String url)
- Returns:
- True iff the url is a network url.
isContentUrl
public static boolean isContentUrl(String url)
- Returns:
- True iff the url is a content: url.
isValidUrl
public static boolean isValidUrl(String url)
- Returns:
- True iff the url is valid.
stripAnchor
public static String stripAnchor(String url)
- Strips the url of the anchor.
guessFileName
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 contentcontentDisposition - Content-Disposition HTTP header or nullmimeType - Mime-type of the content or null
- Returns:
- suggested filename
Please submit a feedback, bug or feature