URLUtil
public final class URLUtil
extends Object
摘要(Summary)
Public constructors
公共方法(Public methods)
composeSearchUrl
String composeSearchUrl (String inQuery,
String template,
String queryPlaceHolder)
参数(Parameters) |
inQuery |
String
|
template |
String
|
queryPlaceHolder |
String
|
decode
byte[] decode (byte[] url)
guessFileName
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 |
guessUrl
String guessUrl (String inUrl)
清除(如果可能)用户输入的网址
参数(Parameters) |
inUrl |
String
|
isAboutUrl
boolean isAboutUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is an about: url. |
isAssetUrl
boolean isAssetUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is an asset file. |
isContentUrl
boolean isContentUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is a content: url. |
isCookielessProxyUrl
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. |
isDataUrl
boolean isDataUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is a data: url. |
isFileUrl
boolean isFileUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is a local file. |
isHttpUrl
boolean isHttpUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is an http: url. |
isHttpsUrl
boolean isHttpsUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is an https: url. |
isJavaScriptUrl
boolean isJavaScriptUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is a javascript: url. |
isNetworkUrl
boolean isNetworkUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is a network url. |
isValidUrl
boolean isValidUrl (String url)
参数(Parameters) |
url |
String
|
返回(Returns) |
boolean |
True iff the url is valid. |
stripAnchor
String stripAnchor (String url)
剥离锚点的网址。
参数(Parameters) |
url |
String
|