Build 1.0_r1(from source)

android.webkit
Class CacheLoader

java.lang.Object
  extended by android.os.Handler
      extended by android.webkit.StreamLoader
          extended by android.webkit.CacheLoader

 class CacheLoader
extends StreamLoader

This class is a concrete implementation of StreamLoader that uses a CacheResult as the source for the stream. The CacheResult stored mimetype and encoding is added to the HTTP response headers.


Field Summary
(package private)  CacheManager.CacheResult mCacheResult
           
 
Fields inherited from class android.webkit.StreamLoader
mContentLength, mDataStream, mHandler, NO_STORE
 
Constructor Summary
CacheLoader(LoadListener loadListener, CacheManager.CacheResult result)
          Constructs a CacheLoader for use when loading content from the cache.
 
Method Summary
protected  void buildHeaders(Headers headers)
          This method is called when the headers are about to be sent to the load framework.
protected  boolean setupStreamAndSendStatus()
          This method is called when the derived class should setup mDataStream, and call mHandler.status() to indicate that the load can occur.
 
Methods inherited from class android.webkit.StreamLoader
handleMessage, load
 
Methods inherited from class android.os.Handler
dispatchMessage, dump, getLooper, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mCacheResult

CacheManager.CacheResult mCacheResult
Constructor Detail

CacheLoader

CacheLoader(LoadListener loadListener,
            CacheManager.CacheResult result)
Constructs a CacheLoader for use when loading content from the cache.

Parameters:
loadListener - LoadListener to pass the content to
result - CacheResult used as the source for the content.
Method Detail

setupStreamAndSendStatus

protected boolean setupStreamAndSendStatus()
Description copied from class: StreamLoader
This method is called when the derived class should setup mDataStream, and call mHandler.status() to indicate that the load can occur. If it fails to setup, it should still call status() with the error code.

Specified by:
setupStreamAndSendStatus in class StreamLoader
Returns:
true if stream was successfully setup

buildHeaders

protected void buildHeaders(Headers headers)
Description copied from class: StreamLoader
This method is called when the headers are about to be sent to the load framework. The derived class has the opportunity to add addition headers.

Specified by:
buildHeaders in class StreamLoader
Parameters:
headers - Map of HTTP headers that will be sent to the loader.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature