Class PropertiesBasedResumableProcessor
- java.lang.Object
-
- org.asynchttpclient.handler.resumable.PropertiesBasedResumableProcessor
-
- All Implemented Interfaces:
ResumableAsyncHandler.ResumableProcessor
public class PropertiesBasedResumableProcessor extends Object implements ResumableAsyncHandler.ResumableProcessor
AResumableAsyncHandler.ResumableProcessorwhich use a properties file to store the download index information.
-
-
Constructor Summary
Constructors Constructor Description PropertiesBasedResumableProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Long>load()Load theMapin memory, contains information about the transferred bytes.voidput(String url, long transferredBytes)Associate a key with the number of bytes successfully transferred.voidremove(String uri)Remove the key associate value.voidsave(Map<String,Long> map)Save the currentMapinstance which contains information about the current transfer state.
-
-
-
Method Detail
-
put
public void put(String url, long transferredBytes)
Description copied from interface:ResumableAsyncHandler.ResumableProcessorAssociate a key with the number of bytes successfully transferred.- Specified by:
putin interfaceResumableAsyncHandler.ResumableProcessor- Parameters:
url- a key. The recommended way is to use an url.transferredBytes- The number of bytes successfully transferred.
-
remove
public void remove(String uri)
Description copied from interface:ResumableAsyncHandler.ResumableProcessorRemove the key associate value.- Specified by:
removein interfaceResumableAsyncHandler.ResumableProcessor- Parameters:
uri- key from which the value will be discarded
-
save
public void save(Map<String,Long> map)
Description copied from interface:ResumableAsyncHandler.ResumableProcessorSave the currentMapinstance which contains information about the current transfer state. This method *only* invoked when the JVM is shutting down.- Specified by:
savein interfaceResumableAsyncHandler.ResumableProcessor- Parameters:
map- the current transfer state
-
load
public Map<String,Long> load()
Description copied from interface:ResumableAsyncHandler.ResumableProcessorLoad theMapin memory, contains information about the transferred bytes.- Specified by:
loadin interfaceResumableAsyncHandler.ResumableProcessor- Returns:
Mapcurrent transfer state
-
-