com.ning.http.client.resumable
Class PropertiesBasedResumableProcessor

java.lang.Object
  extended by com.ning.http.client.resumable.PropertiesBasedResumableProcessor
All Implemented Interfaces:
ResumableAsyncHandler.ResumableProcessor

public class PropertiesBasedResumableProcessor
extends Object
implements ResumableAsyncHandler.ResumableProcessor

A ResumableAsyncHandler.ResumableProcessor which use a properties file to store the download index information.


Constructor Summary
PropertiesBasedResumableProcessor()
           
 
Method Summary
 Map<String,Long> load()
          Load the Map in memory, contains information about the transferred bytes.
 void put(String url, long transferredBytes)
          Associate a key with the number of bytes sucessfully transferred.
 void remove(String uri)
          Remove the key associate value.
 void save(Map<String,Long> map)
          Save the current Map instance which contains information about the current transfer state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesBasedResumableProcessor

public PropertiesBasedResumableProcessor()
Method Detail

put

public void put(String url,
                long transferredBytes)
Associate a key with the number of bytes sucessfully transferred.

Specified by:
put in interface ResumableAsyncHandler.ResumableProcessor
Parameters:
url - a key. The recommended way is to use an url.
transferredBytes - The number of bytes sucessfully transferred.

remove

public void remove(String uri)
Remove the key associate value.

Specified by:
remove in interface ResumableAsyncHandler.ResumableProcessor
Parameters:
uri - key from which the value will be discarted

save

public void save(Map<String,Long> map)
Save the current Map instance which contains information about the current transfer state. This method *only* invoked when the JVM is shutting down.

Specified by:
save in interface ResumableAsyncHandler.ResumableProcessor

load

public Map<String,Long> load()
Load the Map in memory, contains information about the transferred bytes.

Specified by:
load in interface ResumableAsyncHandler.ResumableProcessor
Returns:
Map


Copyright © 2011. All Rights Reserved.