sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadEngine.html
com.tencent.sonic.sdk.download
java.lang.Object
所有已实现的接口:android.os.Handler.Callback
public classSonicDownloadEngineextends java.lang.Object
implements android.os.Handler.Callback
an download initiator
字段 | 限定符和类型 | 字段和说明 |
| --- | --- |
| static java.lang.String | TAG
log filter
|
构造器 | 构造器和说明 |
| --- |
| SonicDownloadEngine(SonicDownloadCache cache) |
所有方法 实例方法 具体方法 | 限定符和类型 | 方法和说明 |
| --- | --- |
| void | addSubResourcePreloadTask(java.util.List<java.lang.String> preloadLinks)
preload the sub resource in the "sonic-link" header.
|
| SonicDownloadClient.DownloadTask | download(java.lang.String resourceUrl, java.lang.String ipAddress, java.lang.String cookie, SonicDownloadCallback callback)
start downloading one resource.
|
| boolean | handleMessage(android.os.Message msg) |
| java.lang.Object | onRequestSubResource(java.lang.String url, SonicSession session)
When the webview initiates a sub resource interception, the client invokes this method to retrieve the data
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final java.lang.String TAG
log filter 另请参阅:常量字段值
-
public SonicDownloadEngine([SonicDownloadCache](../../../../../com/tencent/sonic/sdk/download/SonicDownloadCache.html "com.tencent.sonic.sdk.download中的类")cache)
参数:cache - A specific implementation of SonicDownloadCache
-
public boolean handleMessage(android.os.Message msg)
指定者:handleMessage 在接口中 android.os.Handler.Callback
-
public[SonicDownloadClient.DownloadTask](../../../../../com/tencent/sonic/sdk/download/SonicDownloadClient.DownloadTask.html "com.tencent.sonic.sdk.download中的类")download(java.lang.String resourceUrl,
java.lang.String ipAddress,
java.lang.String cookie,[SonicDownloadCallback](../../../../../com/tencent/sonic/sdk/download/SonicDownloadCallback.html "com.tencent.sonic.sdk.download中的接口")callback)
start downloading one resource. if the responding cache exists and isn't expire, will use the cache directly and won't launch a http request; if the number of downloading tasks is bigger than config, the task will be delayed before downloading pool is free.
参数:resourceUrl - the resource's urlipAddress - if dns prefetch the ip address, will use the ip instead of hostcookie - set the cookie for the download http requestcallback - a callback used for notify the download progress and result返回:the download task info
-
public java.lang.Object onRequestSubResource(java.lang.String url,[SonicSession](../../../../../com/tencent/sonic/sdk/SonicSession.html "com.tencent.sonic.sdk中的类")session)
When the webview initiates a sub resource interception, the client invokes this method to retrieve the data
参数:url - The url of sub resourcesession - current sonic session返回:Return the data to kernel
-
public void addSubResourcePreloadTask(java.util.List<java.lang.String> preloadLinks)
preload the sub resource in the "sonic-link" header.
参数:preloadLinks - The links which need to be preloaded.