Class PropertiesBasedResumableProcessor
- java.lang.Object
-
- org.asynchttpclient.handler.resumable.PropertiesBasedResumableProcessor
-
- All Implemented Interfaces:
ResumableAsyncHandler.ResumableProcessor
public class PropertiesBasedResumableProcessor extends Object implements ResumableAsyncHandler.ResumableProcessor
AResumableAsyncHandler.ResumableProcessor
which 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 theMap
in memory, contains information about the transferred bytes.void
put(String url, long transferredBytes)
Associate a key with the number of bytes successfully transferred.void
remove(String uri)
Remove the key associate value.void
save(Map<String,Long> map)
Save the currentMap
instance which contains information about the current transfer state.
-
-
-
Method Detail
-
put
public void put(String url, long transferredBytes)
Description copied from interface:ResumableAsyncHandler.ResumableProcessor
Associate a key with the number of bytes successfully transferred.- Specified by:
put
in 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.ResumableProcessor
Remove the key associate value.- Specified by:
remove
in 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.ResumableProcessor
Save the currentMap
instance which contains information about the current transfer state. This method *only* invoked when the JVM is shutting down.- Specified by:
save
in interfaceResumableAsyncHandler.ResumableProcessor
- Parameters:
map
- the current transfer state
-
load
public Map<String,Long> load()
Description copied from interface:ResumableAsyncHandler.ResumableProcessor
Load theMap
in memory, contains information about the transferred bytes.- Specified by:
load
in interfaceResumableAsyncHandler.ResumableProcessor
- Returns:
Map
current transfer state
-
-