Build 1.0_r1(from source)

android.webkit
Class DataLoader

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

 class DataLoader
extends StreamLoader

This class is a concrete implementation of StreamLoader that uses the content supplied as a URL as the source for the stream. The mimetype optionally provided in the URL is extracted and inserted into the HTTP response headers.


Field Summary
 
Fields inherited from class android.webkit.StreamLoader
mContentLength, mDataStream, mHandler, NO_STORE
 
Constructor Summary
DataLoader(String dataUrl, LoadListener loadListener)
          Constructor uses the dataURL as the source for an InputStream
 
Method Summary
protected  void buildHeaders(Headers headers)
          This method is called when the headers are about to be sent to the load framework.
static void requestUrl(String url, LoadListener loadListener)
          Construct a DataLoader and instruct it to start loading.
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
 

Constructor Detail

DataLoader

DataLoader(String dataUrl,
           LoadListener loadListener)
Constructor uses the dataURL as the source for an InputStream

Parameters:
dataUrl - data: URL string optionally containing a mimetype
loadListener - LoadListener to pass the content to
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.

requestUrl

public static void requestUrl(String url,
                              LoadListener loadListener)
Construct a DataLoader and instruct it to start loading.

Parameters:
url - data: URL string optionally containing a mimetype
loadListener - LoadListener to pass the content to

Build 1.0_r1(from source)

Please submit a feedback, bug or feature