com.sonalb.net.http
Class HeaderUtils

java.lang.Object
  extended by com.sonalb.net.http.HeaderUtils

public final class HeaderUtils
extends java.lang.Object

Utility class with methods relevant to HTTP Headers.

Author:
Sonal Bansal

Method Summary
static Header extractHeaders(java.net.URLConnection uc)
          Extracts the headers from the input URLConnection, and populates them in a Header instance.
static void setHeaders(java.net.URLConnection uc, Header h)
          Converts the Header input, into properties in the URLConnection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extractHeaders

public static Header extractHeaders(java.net.URLConnection uc)
Extracts the headers from the input URLConnection, and populates them in a Header instance.

Parameters:
uc - a connected URLConnection
Returns:
the Header; always non-null

setHeaders

public static void setHeaders(java.net.URLConnection uc,
                              Header h)
Converts the Header input, into properties in the URLConnection.

Parameters:
uc - an un-connected URLConnection
h - a Header