rabbit.proxy
Class PartialCacher

java.lang.Object
  extended by rabbit.proxy.PartialCacher

public class PartialCacher
extends Object

An updater that writes an updated range to a cache file.

Author:
Robert Olofsson

Constructor Summary
PartialCacher(File fileName, HttpHeader response)
          Create a new PartialCacher that will update the given file with data from the given response.
 
Method Summary
 WritableByteChannel getChannel()
          Get the channel that is written to.
 long getEnd()
          Get the end position of the range.
 long getStart()
          Get the start position of the range.
 long getTotal()
          Get the size of the range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialCacher

public PartialCacher(File fileName,
                     HttpHeader response)
              throws IOException
Create a new PartialCacher that will update the given file with data from the given response.

Parameters:
fileName - the cache resource to update
response - the response header
Throws:
IOException - if updating the cached resource fails
Method Detail

getChannel

public WritableByteChannel getChannel()
Get the channel that is written to.

Returns:
the channel that the resource is cached to

getStart

public long getStart()
Get the start position of the range.

Returns:
the start position of the range

getEnd

public long getEnd()
Get the end position of the range.

Returns:
the end position of the range

getTotal

public long getTotal()
Get the size of the range

Returns:
the number of bytes for the range