org.javaswift.joss.headers.object.range
Class AbstractRange

java.lang.Object
  extended by org.javaswift.joss.headers.Header
      extended by org.javaswift.joss.headers.object.range.AbstractRange
Direct Known Subclasses:
ExcludeStartRange, FirstPartRange, LastPartRange, MidPartRange

public abstract class AbstractRange
extends Header

Offers the option to return not the entire object, but only a designated part. The various options are

Also see: http://docs.openstack.org/api/openstack-object-storage/1.0/content/retrieve-object.html


Field Summary
protected  int length
           
protected  int offset
           
 String RANGE_HEADER_NAME
           
 String RANGE_HEADER_VALUE_PREFIX
           
 
Constructor Summary
protected AbstractRange(int offset, int length)
           
 
Method Summary
 byte[] copy(byte[] original)
           
abstract  int getFrom(int byteArrayLength)
           
 String getHeaderName()
          Returns the header name that must be set in the request.
 String getHeaderValue()
          Returns the value that must be set in the request.
abstract  int getTo(int byteArrayLength)
           
 
Methods inherited from class org.javaswift.joss.headers.Header
convertResponseHeader, getResponseHeadersStartingWith, headerNotEmpty, setHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANGE_HEADER_NAME

public String RANGE_HEADER_NAME

RANGE_HEADER_VALUE_PREFIX

public String RANGE_HEADER_VALUE_PREFIX

offset

protected int offset

length

protected int length
Constructor Detail

AbstractRange

protected AbstractRange(int offset,
                        int length)
Method Detail

getHeaderValue

public String getHeaderValue()
Description copied from class: Header
Returns the value that must be set in the request. Eg, "bytes: 4-12"

Specified by:
getHeaderValue in class Header
Returns:
the value for the request header

getHeaderName

public String getHeaderName()
Description copied from class: Header
Returns the header name that must be set in the request. Eg, "Range"

Specified by:
getHeaderName in class Header
Returns:
the name for the request header

getFrom

public abstract int getFrom(int byteArrayLength)

getTo

public abstract int getTo(int byteArrayLength)

copy

public byte[] copy(byte[] original)


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