public final class URLUtil
extends Object
| java.lang.Object | |
| ↳ | android.webkit.URLUtil |
Public constructors |
|
|---|---|
URLUtil() |
|
Public methods |
|
|---|---|
static String |
composeSearchUrl(String inQuery, String template, String queryPlaceHolder) |
static byte[] |
decode(byte[] url) |
static final String |
guessFileName(String url, String contentDisposition, String mimeType) 使用URL和contentDisposition来猜测下载可能具有的规范文件名。 |
static String |
guessUrl(String inUrl) 清除(如果可能)用户输入的网址 |
static boolean |
isAboutUrl(String url) |
static boolean |
isAssetUrl(String url) |
static boolean |
isContentUrl(String url) |
static boolean |
isCookielessProxyUrl(String url) 此方法已在API级别3中弃用。无Cookie代理不再受支持。 |
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) 剥离锚点的网址。 |
Inherited methods |
|
|---|---|
java.lang.Object
|
|
String composeSearchUrl (String inQuery, String template, String queryPlaceHolder)
| Parameters | |
|---|---|
inQuery |
String
|
template |
String
|
queryPlaceHolder |
String
|
| Returns | |
|---|---|
String |
|
byte[] decode (byte[] url)
| Parameters | |
|---|---|
url |
byte
|
| Returns | |
|---|---|
byte[] |
|
| Throws | |
|---|---|
IllegalArgumentException |
|
String guessFileName (String url, String contentDisposition, String mimeType)
使用URL和contentDisposition来猜测下载可能具有的规范文件名。 如果没有定义文件扩展名,则根据MIME类型添加
| Parameters | |
|---|---|
url |
String: Url to the content |
contentDisposition |
String: Content-Disposition HTTP header or null |
mimeType |
String: Mime-type of the content or null |
| Returns | |
|---|---|
String |
suggested filename |
String guessUrl (String inUrl)
清除(如果可能)用户输入的网址
| Parameters | |
|---|---|
inUrl |
String
|
| Returns | |
|---|---|
String |
|
boolean isAboutUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is an about: url. |
boolean isAssetUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is an asset file. |
boolean isContentUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is a content: url. |
boolean isCookielessProxyUrl (String url)
此方法在API级别3中已被弃用。
Cookieless代理不再受支持。
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is a proxy url to allow cookieless network requests from a file url. |
boolean isDataUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is a data: url. |
boolean isFileUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is a local file. |
boolean isHttpUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is an http: url. |
boolean isHttpsUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is an https: url. |
boolean isJavaScriptUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is a javascript: url. |
boolean isNetworkUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is a network url. |
boolean isValidUrl (String url)
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
boolean |
True iff the url is valid. |
String stripAnchor (String url)
剥离锚点的网址。
| Parameters | |
|---|---|
url |
String
|
| Returns | |
|---|---|
String |
|