FileDownloader v0.3.3 Release Notes
-
2016-07-10
๐ New Interfaces
- โ Add
FileDownloadUtils#getTempPath
: Get the temp path is used for storing the temporary file not completed downloading yet(filename.temp
). Refs #172. - โ Add
FileDownloader#getStatusIgnoreCompleted(id:int)
: Get the downloading status without cover the completed status(If completed you will receiveINVALID
). - โ Add
FileDownloader#getStatus(id:int, path:String)
: Get the downloading status. - โ Add
FileDownloader#getStatus(url:String, path:String)
: Get the downloading status. - โ Add
FileDownloadUtils#isFilenameConverted(context:Context)
: Whether tasks from FileDownloader Database has converted all files' name fromfilename
(in old architecture) tofilename.temp
, if it is not completed downloading yet. - โ Add
FileDownloadUtils#generateId(url:String, path:String, pathAsDirectory:boolean)
: Generate aDownload Id
which can be recognized in FileDownloader. - โ Add
BaseDownloadTask#setPath(path:String, pathAsDirectory:boolean)
: IfpathAsDirectory
istrue
, thepath
would be the absolute directory to store the downloading file, and thefilename
will be found incontentDisposition
from theresponse#header
as default. - โ Add
BaseDownloadTask#isPathAsDirectory
: Whether the result ofBaseDownloadTask#getPath()
is adirectory
path ordirectory/filename
path. - โ Add
BaseDownloadTask#getTargetFilePath
: Get the target file path to store the downloading file. - โ Add
FileDownloadQueueSet#setDirectory
: Set thedirectory
to store files in this queue.
โจ Enhancement
- ๐ Improve Practicability: Support the
path
of the task as the directory to store the file, and in this case, thefilename
will be found incontentDisposition
from theresponse#header
as default. Refs #200. - ๐ Improve Practicability: Using the temp path to store the file not completed downloading yet(
filename.temp
). Refs #172. - ๐ Improve Performance: FileDownloader doesn't store completed tasks in Database anymore, and check whether the task has completed downloading with
File#exists()
directly. Refs #176, #172. - ๐ Improve Robust: Choosing the task which status is
INVALID
orprogress
to receivecompleted
message preferentially, to ensure the callback ofprogress
can be handled. Refs #123 - ๐ Improve Robust: Expanding task-sync-lock to the outside of getting-same-id-downloading-task, to fix some messages can't be consumed because status changed during getting-same-id-downloading-task and waiting for task-sync-lock.
๐ Fix
- ๐ Fix(DB-maintain): Keeping models, whose status is
pending
and downloaded so far bytes is more than 0 because it can be used for resuming from the breakpoint. Closes #176. - ๐ Fix(crash-NPE): FileDownloader might occur NPE when the download-listener was removed, but the task is still running in FileDownloader. Closes #171.
- โ Add