Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mortbay.http
Class InclusiveByteRange  view InclusiveByteRange download InclusiveByteRange.java

java.lang.Object
  extended byorg.mortbay.http.InclusiveByteRange

public class InclusiveByteRange
extends java.lang.Object

Byte range inclusive of end points.

 
   parses the following types of byte ranges:
 
       bytes=100-499
       bytes=-300
       bytes=100-
       bytes=1-2,2-3,6-,-2

   given an entity length, converts range to string
 
       bytes 100-499/500
 
 
Based on RFC2616 3.12, 14.16, 14.35.1, 14.35.2

Version:
$version$

Field Summary
(package private)  long first
           
(package private)  long last
           
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
InclusiveByteRange(long first, long last)
           
 
Method Summary
 long getFirst()
           
 long getFirst(long size)
           
 long getLast()
           
 long getLast(long size)
           
 long getSize(long size)
           
static java.util.List satisfiableRanges(java.util.Enumeration headers, long size)
           
static java.lang.String to416HeaderRangeString(long size)
           
 java.lang.String toHeaderRangeString(long size)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

first

long first

last

long last
Constructor Detail

InclusiveByteRange

public InclusiveByteRange(long first,
                          long last)
Method Detail

getFirst

public long getFirst()

getLast

public long getLast()

satisfiableRanges

public static java.util.List satisfiableRanges(java.util.Enumeration headers,
                                               long size)

getFirst

public long getFirst(long size)

getLast

public long getLast(long size)

getSize

public long getSize(long size)

toHeaderRangeString

public java.lang.String toHeaderRangeString(long size)

to416HeaderRangeString

public static java.lang.String to416HeaderRangeString(long size)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).