org.lobobrowser.ua
Interface ConnectionProcessor


public interface ConnectionProcessor

A connection pre- and post-processor.

See Also:
NavigatorExtensionContext.addConnectionProcessor(ConnectionProcessor)

Field Summary
static ConnectionProcessor[] EMPTY_ARRAY
           
 
Method Summary
 java.net.URLConnection processPostConnection(java.net.URLConnection connection)
          This method is called after a connection has been established.
 java.net.URLConnection processPreConnection(java.net.URLConnection connection)
          This method is called after the request method and standard headers have been set, and before a connection has been established or content has been posted.
 

Field Detail

EMPTY_ARRAY

static final ConnectionProcessor[] EMPTY_ARRAY
Method Detail

processPreConnection

java.net.URLConnection processPreConnection(java.net.URLConnection connection)
This method is called after the request method and standard headers have been set, and before a connection has been established or content has been posted. Changing request properties (headers) is permitted but any other changes could affect the operation of the platform.

Parameters:
connection - A URL connection.
Returns:
It should return the connection object passed as a parameter. A different connection object can be returned if that's necessary (e.g. wrapping the original connection in order to process its POST stream).

processPostConnection

java.net.URLConnection processPostConnection(java.net.URLConnection connection)
This method is called after a connection has been established. At this point there should be a response code and response headers, but the input stream has not been read yet.

Note: Reading from the input stream of the connection must not be done, unless a replacement stream is provided in the connection that is returned by the method.

Parameters:
connection - A URL connection.
Returns:
It should return the connection object passed as a parameter. A different connection object can be returned if that's necessary (e.g. wrapping the original connection in order to process its input stream).


SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Lobo Home]