Build 1.0_r1(from source)

android.webkit
Class URLUtil

java.lang.Object
  extended by android.webkit.URLUtil

public final class URLUtil
extends Object


Field Summary
(package private) static String ASSET_BASE
           
(package private) static String FILE_BASE
           
(package private) static String PROXY_BASE
           
 
Constructor Summary
URLUtil()
           
 
Method Summary
static String composeSearchUrl(String inQuery, String template, String queryPlaceHolder)
           
static byte[] decode(byte[] url)
           
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)
           
static boolean isDataUrl(String url)
           
static boolean isFileUrl(String url)
           
static boolean isHttpsUrl(String url)
           
static boolean isHttpUrl(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

URLUtil

public URLUtil()
Method Detail

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 content
contentDisposition - Content-Disposition HTTP header or null
mimeType - Mime-type of the content or null
Returns:
suggested filename

Build 1.0_r1(from source)

Please submit a feedback, bug or feature