org.javaswift.joss.headers
Class Header

java.lang.Object
  extended by org.javaswift.joss.headers.Header
Direct Known Subclasses:
AbstractRange, ConnectionKeepAlive, ContainerRights, DateHeader, DeleteAfter, SimpleHeader

public abstract class Header
extends Object

Basic header that needs to be added to a command. The underlying implementation takes care of the specifics for a header.


Constructor Summary
Header()
           
 
Method Summary
static String convertResponseHeader(org.apache.http.HttpResponse response, String name)
           
abstract  String getHeaderName()
          Returns the header name that must be set in the request.
abstract  String getHeaderValue()
          Returns the value that must be set in the request.
static List<org.apache.http.Header> getResponseHeadersStartingWith(org.apache.http.HttpResponse response, String prefix)
           
static boolean headerNotEmpty(org.apache.http.HttpResponse response, String headerName)
           
 void setHeader(org.apache.http.client.methods.HttpRequestBase request)
          Called before executing the request by the AbstractCommand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Header

public Header()
Method Detail

setHeader

public void setHeader(org.apache.http.client.methods.HttpRequestBase request)
Called before executing the request by the AbstractCommand. Makes sure the header is set on the request object

Parameters:
request - the request to which the header must be applied

getHeaderValue

public abstract String getHeaderValue()
Returns the value that must be set in the request. Eg, "bytes: 4-12"

Returns:
the value for the request header

getHeaderName

public abstract String getHeaderName()
Returns the header name that must be set in the request. Eg, "Range"

Returns:
the name for the request header

getResponseHeadersStartingWith

public static List<org.apache.http.Header> getResponseHeadersStartingWith(org.apache.http.HttpResponse response,
                                                                          String prefix)

convertResponseHeader

public static String convertResponseHeader(org.apache.http.HttpResponse response,
                                           String name)

headerNotEmpty

public static boolean headerNotEmpty(org.apache.http.HttpResponse response,
                                     String headerName)


Copyright © 2012-2014 42 BV. All Rights Reserved.