Stores header properties for HTTP connections sent or received from an HTTP
server.
The HttpConnection implementation uses these objects internally
to store the set of properties that are either sent to or received from an
HTTP server.
Content protection
By default, HttpHeaders are not protected via content protection.
However, to invoke protection a single call to reCrypt will ensure that all
of the values stored in this class are encrypted. As well, all future
additions of data to the class will be protected.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Creates a new HttpHeaders instance parsed from a provided data input stream.
Parameters:
dins - DataInputStream to provide header data.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Creates a new HttpHeaders instance from the contents of a provided hashtable.
Parameters:
headers - Hashtable to provide header data.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Adds a new key/value pair to the header list.
An application can use this method to add its own custom HTTP headers to
transmit to the server. If a property with the specified key already
exists, the new value will still be placed in the list and the old one
will remain.
Parameters:
key - Key for the value to set.
value - Value to associate with the provided key.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
checkCrypt
public boolean checkCrypt()
Determines if all header values held in this class are properly protected.
Returns:
True if all contained properties are currently encrypted;
otherwise, false.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
This method reads in header data from a provided hashtable. Note
that the receive headers are appended to the headers that already exist
in this object's list (if you want to create a new list from this
hashtable, first invoke reset()).
Parameters:
ht - Hashtable from which to read the header data.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Retrieves the key of the header at the provided position.
Parameters:
position - Position within the header list to examine.
Returns:
Key of the property occupying your provided position, or null if
no such position exists.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Retrieves the value of the header at the provided position.
Parameters:
position - Position within the header list to examine.
Returns:
Value of the property occupying your provided position, or null
if no such position exists.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Retrieves first header property value for provided key.
This method retrieves the first property matching your provided key.
Parameters:
key - Key for property to retrieve.
Returns:
Value of the header property associated with provided key, or
null if no such property.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
This method retrieves all properties that match your provided key.
Parameters:
key - Key associated with one or more header properties to retrieve.
Returns:
Vector containing all properties that have an associated key
matching your provided key, or null if no such properties exist.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
isProtected
public boolean isProtected()
Determines if the headers have been encrypted via content-protection.
Returns:
True if header contents have been protected; otherwise, false.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
This method reads in header data from provided data input
stream. Note that the received headers are appended to the headers that
already exist in this object's list (if you want to create a new list
from this input stream, first invoke reset()).
This method assumes the individual header elements in the read list
are separated by CRLF pairs.
Parameters:
aDataInputStream - Input stream from which to read the header data.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
reCrypt
public void reCrypt()
Encrypt the header values via content protection.
Once this method is invoked, any future data placed in this object
will be encrypted by default.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Removes all header properties identified by provided key.
This method removes all the property values that match the provided key.
Parameters:
key - Key to look for.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
removeProperty
public void removeProperty(int keyPosition)
Removes header property identified by provided key position.
This method removes the property value at your provided key
position, and the key itself as well.
Parameters:
keyPosition - Key position of the header property to remove; if this
position does not already exist in the list, this method does nothing.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
reset
public void reset()
Clears all the current keys and values from the header list.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
setProperties
public void setProperties(HttpHeaders otherHeaders)
Sets the HTTP headers.
Combines values from the passed in object with the values of this object.
If values in 'this' object match values in otherHeaders, the values in 'this' object are removed.
This method is useful for handling HTTP 304 response
codes when updating data in caches.
Parameters:
otherHeaders - Other HTTP headers to union.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
setProperty
public void setProperty(int keyPosition,
String value)
Sets new value for header at provided key position in the list.
Parameters:
keyPosition - Position of the key in the list to update: if this
position does not already exist in the list, this method does nothing.
value - New value to associated with identified key.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
An application can invoke this method to set its own custom HTTP
headers to transmit to the server. If a property with the specified key
already exists, this method replaces the old value with the new value.
If more than one property with the specified key already exists, only
the first one in the list gets its value updated.
Parameters:
key - Key for the value to set.
value - Value to associate with the provided key.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
size
public int size()
Retrieves the number of keys current stored in the header list.
Returns:
Number of keys currently in the header list.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Converts this collection of headers into a hashtable.
Warning: If there are duplicate headers in this object,
only the last of each set of duplicate headers gets written
into the hashtable.
Returns:
Hashtable containing converted header properties.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved. Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. Copyright 2002-2003 Nokia Corporation All Rights Reserved. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.