public class PropertiesBasedResumableProcessor extends Object implements ResumableAsyncHandler.ResumableProcessor
ResumableAsyncHandler.ResumableProcessor
which use a properties file
to store the download index information.Constructor and Description |
---|
PropertiesBasedResumableProcessor() |
Modifier and Type | Method and Description |
---|---|
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 successfully 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. |
public void put(String url, long transferredBytes)
put
in interface ResumableAsyncHandler.ResumableProcessor
url
- a key. The recommended way is to use an url.transferredBytes
- The number of bytes successfully transferred.public void remove(String uri)
remove
in interface ResumableAsyncHandler.ResumableProcessor
uri
- key from which the value will be discardedpublic void save(Map<String,Long> map)
Map
instance which contains information about the current transfer state.
This method *only* invoked when the JVM is shutting down.save
in interface ResumableAsyncHandler.ResumableProcessor
map
- the current transfer stateCopyright © 2015. All Rights Reserved.