public class FileDownloadModel extends Object implements Parcelable
FileDownloadDatabaseParcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static String |
CONNECTION_COUNT |
static Parcelable.Creator<FileDownloadModel> |
CREATOR |
static int |
DEFAULT_CALLBACK_PROGRESS_TIMES |
static String |
ERR_MSG |
static String |
ETAG |
static String |
FILENAME |
static String |
ID |
static String |
PATH |
static String |
PATH_AS_DIRECTORY |
static String |
SOFAR |
static String |
STATUS |
static String |
TOTAL |
static int |
TOTAL_VALUE_IN_CHUNKED_RESOURCE |
static String |
URL |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Modifier | Constructor and Description |
|---|---|
|
FileDownloadModel() |
protected |
FileDownloadModel(Parcel in) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteTargetFile() |
void |
deleteTaskFiles() |
void |
deleteTempFile() |
int |
describeContents() |
int |
getConnectionCount() |
String |
getErrMsg() |
String |
getETag() |
String |
getFilename() |
int |
getId() |
String |
getPath()
Get the path user set from
BaseDownloadTask.setPath(String) |
long |
getSoFar() |
byte |
getStatus() |
String |
getTargetFilePath()
Get the finally target file path is used for store the download file.
|
String |
getTempFilePath() |
long |
getTotal() |
String |
getUrl() |
void |
increaseSoFar(long increaseBytes) |
boolean |
isChunked() |
boolean |
isLargeFile() |
boolean |
isPathAsDirectory() |
void |
resetConnectionCount()
reset the connection count to default value: 1.
|
void |
setConnectionCount(int connectionCount) |
void |
setErrMsg(String errMsg) |
void |
setETag(String eTag) |
void |
setFilename(String filename) |
void |
setId(int id) |
void |
setPath(String path,
boolean pathAsDirectory) |
void |
setSoFar(long soFar) |
void |
setStatus(byte status) |
void |
setTotal(long total) |
void |
setUrl(String url) |
ContentValues |
toContentValues() |
String |
toString() |
void |
writeToParcel(Parcel dest,
int flags) |
public static final int TOTAL_VALUE_IN_CHUNKED_RESOURCE
public static final int DEFAULT_CALLBACK_PROGRESS_TIMES
public static final String ID
public static final String URL
public static final String PATH
public static final String PATH_AS_DIRECTORY
public static final String FILENAME
public static final String STATUS
public static final String SOFAR
public static final String TOTAL
public static final String ERR_MSG
public static final String ETAG
public static final String CONNECTION_COUNT
public static final Parcelable.Creator<FileDownloadModel> CREATOR
public FileDownloadModel()
protected FileDownloadModel(Parcel in)
public void setId(int id)
public void setUrl(String url)
public void setPath(String path, boolean pathAsDirectory)
public void setStatus(byte status)
public void setSoFar(long soFar)
public void increaseSoFar(long increaseBytes)
public void setTotal(long total)
public int getId()
public String getUrl()
public String getPath()
BaseDownloadTask.setPath(String)BaseDownloadTask.setPath(String)getTargetFilePath()public String getTargetFilePath()
path、pathAsDirectory、filename.
Why getPath() may be not equal to getTargetFilePath()? this case only occurred
when the isPathAsDirectory() is true, on this scenario the
getPath() is directory, and the getTargetFilePath() is 'directory + "/" + filename'.public String getTempFilePath()
public byte getStatus()
public long getSoFar()
public long getTotal()
public boolean isChunked()
public String getETag()
public void setETag(String eTag)
public String getErrMsg()
public void setErrMsg(String errMsg)
public void setFilename(String filename)
public boolean isPathAsDirectory()
public String getFilename()
public void setConnectionCount(int connectionCount)
public int getConnectionCount()
public void resetConnectionCount()
public ContentValues toContentValues()
public boolean isLargeFile()
public void deleteTaskFiles()
public void deleteTempFile()
public void deleteTargetFile()
public int describeContents()
describeContents in interface Parcelablepublic void writeToParcel(Parcel dest, int flags)
writeToParcel in interface Parcelable