Top Description Fields Constructors Methods
com.oracle.bmc.model

public Class Range

extends Object
Class Inheritance
Imports
com.oracle.bmc.util.internal.StringUtils

Class specifying a range-request is being made. Request mostly follows https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35, except only one range is allowed. For the purposes of the SDK, three types of requests are supported:
  1. Exact range (0-100): All bytes in the given range
  2. Starts-at (100-): All bytes >= the start byte
  3. Last (-100): The last X bytes

Also used to represent the range returned by the server (including the full content length, if known).

Field Summary

Modifier and TypeField and Description
private Long
contentLength

The content length as returned by the server, or null if unknown.

private static final String
private final Long
endByte

The end byte, if given.

private static final String
private static final Logger
private static final String
private final Long
startByte

The start byte, if given.

Constructor Summary

AccessConstructor and Description
public
Range(final Long startByte, final Long endByte)

Method Summary

Modifier and TypeMethod and Description
public Long
getContentLength()

The content length as returned by the server, or null if unknown.

public Long
getEndByte()

The end byte, if given.

public Long
getStartByte()

The start byte, if given.

public static Range

Returns:

A new Range header.
parse
(String
The response header value.
value
)

Parse the "content-range" header per https://tools.ietf.org/html/rfc7233#section-4.2.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contentLengthback to summary
private Long contentLength

The content length as returned by the server, or null if unknown.

END_ONLY_HEADER_VALUE_FORMATback to summary
private static final String END_ONLY_HEADER_VALUE_FORMAT
endByteback to summary
private final Long endByte

The end byte, if given.

HEADER_VALUE_FORMATback to summary
private static final String HEADER_VALUE_FORMAT
LOGback to summary
private static final Logger LOG
START_ONLY_HEADER_VALUE_FORMATback to summary
private static final String START_ONLY_HEADER_VALUE_FORMAT
startByteback to summary
private final Long startByte

The start byte, if given.

Constructor Detail

Rangeback to summary
public Range(final Long startByte, final Long endByte)
Annotations
@java.beans.ConstructorProperties

Method Detail

getContentLengthback to summary
public Long getContentLength()

The content length as returned by the server, or null if unknown.

getEndByteback to summary
public Long getEndByte()

The end byte, if given.

getStartByteback to summary
public Long getStartByte()

The start byte, if given.

parseback to summary
public static Range parse(String value)

Parse the "content-range" header per https://tools.ietf.org/html/rfc7233#section-4.2.

Note, this is only for successful responses (206). It does not handle 416 (range not satisfiable).

Parameters
value:String

The response header value.

Returns:Range

A new Range header.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override