Class Range

java.lang.Object
org.fcrepo.http.commons.domain.Range

public class Range extends Object
Range header parsing logic
Author:
awoods, whikloj
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Represents a range object based on length
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Range(long start)
    Left-bounded range
  • Method Summary

    Modifier and Type
    Method
    Description
    static Range
    convert(String source)
    Convert an HTTP Range header to a Range object
    protected long
    end()
    End of the range
    protected boolean
    Does this range actually impose limits
    rangeOfLength(long length)
    Create a range object with start and end bytes based on the length of the content.
    protected long
    Length contained in the range
    protected long
    Start of the range

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Range

      protected Range(long start)
      Left-bounded range
      Parameters:
      start - the start
  • Method Details

    • hasRange

      protected boolean hasRange()
      Does this range actually impose limits
      Returns:
      true if the range imposes limits
    • size

      protected long size()
      Length contained in the range
      Returns:
      length of the range
    • start

      protected long start()
      Start of the range
      Returns:
      start of the range, or -1 if no start was specified
    • end

      protected long end()
      End of the range
      Returns:
      end of the range
    • convert

      public static Range convert(String source)
      Convert an HTTP Range header to a Range object
      Parameters:
      source - the source
      Returns:
      range object
    • rangeOfLength

      public Range.RangeOfLength rangeOfLength(long length)
      Create a range object with start and end bytes based on the length of the content.
      Parameters:
      length - the length of the content
      Returns:
      a range of length object