FileDocCategorySizeDatePackage
PluginData.javaAPI DocAndroid 1.5 API3384Wed May 06 22:41:56 BST 2009android.webkit

PluginData

public final class PluginData extends Object
This class encapsulates the content generated by a plugin. The data itself is meant to be loaded into webkit via the PluginContentLoader class, which needs to be able to construct an HTTP response. For this, it needs a stream with the response body, the length of the body, the response headers, and the response status code. The PluginData class is the container for all these parts.

Fields Summary
private InputStream
mStream
The content stream.
private long
mContentLength
The content length.
private Map
mHeaders
The associated HTTP response headers stored as a map of lowercase header name to [ unmodified header name, header value]. TODO: This design was always a hack. Remove (involves updating the Gears C++ side).
private int
mHeaderValueIndex
The index of the header value in the above mapping.
private int
mStatusCode
The associated HTTP response code.
Constructors Summary
public PluginData(InputStream stream, long length, Map headers, int code)
Creates a PluginData instance.

param
stream The stream that supplies content for the plugin.
param
length The length of the plugin content.
param
headers The response headers. Map of lowercase header name to [ unmodified header name, header value]
param
length The HTTP response status code.

        mStream = stream;
        mContentLength = length;
        mHeaders = headers;
        mStatusCode = code;
    
Methods Summary
public longgetContentLength()
Returns the length of the plugin content.

return
the length of the plugin content.

        return mContentLength;
    
public java.util.MapgetHeaders()
Returns the HTTP response headers associated with the plugin content.

return
A Map containing all headers. The mapping is 'lowercase header name' to ['unmodified header name', header value].

        return mHeaders;
    
public java.io.InputStreamgetInputStream()
Returns the input stream that contains the plugin content.

return
An InputStream instance with the plugin content.

        return mStream;
    
public intgetStatusCode()
Returns the HTTP status code for the response.

return
The HTTP statue code, e.g 200.

        return mStatusCode;