rabbit.http
Class ContentRangeParser

java.lang.Object
  extended by rabbit.http.ContentRangeParser

public class ContentRangeParser
extends Object

A class that parses content range headers.

Author:
Robert Olofsson

Constructor Summary
ContentRangeParser(String cr, Logger logger)
          Try to parse the given content range.
 
Method Summary
 long getEnd()
          Get the end index.
 long getStart()
          Get the start index
 long getTotal()
          Get the total size of the resource.
 boolean isValid()
          Check if the content range was valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentRangeParser

public ContentRangeParser(String cr,
                          Logger logger)
Try to parse the given content range.

Parameters:
cr - the Content-Range header.
logger - the logger to use for warnings.
Method Detail

isValid

public boolean isValid()
Check if the content range was valid.


getStart

public long getStart()
Get the start index


getEnd

public long getEnd()
Get the end index.


getTotal

public long getTotal()
Get the total size of the resource.

Returns:
the resource size if know or -1 if unknown ('*' was used in the content range).