org.javaswift.joss.headers.object.range
Class AbstractRange
java.lang.Object
org.javaswift.joss.headers.Header
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
ExcludeStartRange
- take the object starting from position x until the end
FirstPartRange
- take the first x bytes of the object, starting at position 0
MidPartRange
- take the object from offset for a certain length
LastPartRange
- take the last x bytes, starting at the end minus x until the end
Also see: http://docs.openstack.org/api/openstack-object-storage/1.0/content/retrieve-object.html
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
AbstractRange
protected AbstractRange(int offset,
int length)
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.