com.github.axet.wget.info
Class DownloadInfo
java.lang.Object
com.github.axet.wget.info.URLInfo
com.github.axet.wget.info.DownloadInfo
public class DownloadInfo
- extends URLInfo
DownloadInfo class. Keep part information. We need to serialize this class
between application restart. Thread safe.
- Author:
- axet
| Methods inherited from class com.github.axet.wget.info.URLInfo |
empty, extract, extractNormal, extractRange, getContentFilename, getContentType, getDelay, getException, getLength, getRange, getSource, getState, setDelay, setException, setRange, setState, setState |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PART_LENGTH
public static final long PART_LENGTH
- See Also:
- Constant Field Values
DownloadInfo
public DownloadInfo(URL source)
multipart
public boolean multipart()
- is it a multipart download?
- Returns:
reset
public void reset()
calculate
public void calculate()
- for multi part download, call every time when we need to know totol
download progress
getParts
public List<DownloadInfo.Part> getParts()
enableMultipart
public void enableMultipart()
resume
public boolean resume(DownloadInfo newSource)
- Check if we can continue download a file from new source. Check if new
souce has the same file length, title. and supports for range
- Parameters:
newSource - new source
- Returns:
- true - possible to resume from new location
copy
public void copy(DownloadInfo oldSource)
- copy resume data from oldSource;
getCount
public long getCount()
setCount
public void setCount(long count)
extract
public void extract(AtomicBoolean stop,
Runnable notify)
- Overrides:
extract in class URLInfo
Copyright © 2012. All Rights Reserved.