rabbit.proxy
Class PartialCacher

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

public class PartialCacher
extends java.lang.Object

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

Author:
Robert Olofsson

Constructor Summary
PartialCacher(java.lang.String fileName, HttpHeader response)
          Create a new PartialCacher that will update the given file with data from the given response.
 
Method Summary
 java.nio.channels.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(java.lang.String fileName,
                     HttpHeader response)
              throws java.io.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:
java.io.IOException - if updating the cached resource fails
Method Detail

getChannel

public java.nio.channels.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