Releases: lingochamp/FileDownloader
Releases · lingochamp/FileDownloader
v1.3.9
Important:
- Since this version you can customize you own FileDownloadConnection component, we use this one as default.
- Since this version, FileDownloader don't dependency the okhttp as default.
If you still need to configure
timeout
、proxy
for the connection component, but you don't want to implement your own one, configurations, I implement it for the default connection component too, just move to: DemoApplication, check the code if you want.
New Interfaces
v1.3.0
New Interfaces
- Add
FileDownloadSerialQueue
: Easy to dynamically manage tasks and tasks in the queue will automatically start download one by one. Closes #345. - Remove the
callback
method in theFileDownloadListener
class, besides adding theFileDownloadListener#isInvalid
method to tell the FileDownloader whether the listener has already invalidated, which means it can't receive any messages. - Add
FileDownloader#clearAllTaskData
: Clear all data in thefiledownloader
database. Closes #361
Enhancement
- Improve Practicability(
FileDownloadListener#blackCompleted
): Ensure theblockCompleted
callback method can accept anyException
. Closes #369. - Improve Practicability(service-not-connected): Print the tips with the cause in service-not-connected-helper, in this way, when you invoke some methods need the FileDownload service has already connected but not yet, FileDownloader will not only print causes in the
Logcat
but also print the tips.
Fix
- Fix(reuse): fix
BaseDownloadTask#reuse
is called shortly after the call toBaseDownloadTask#pause
may raise an exception. Closes #329.
v1.2.2
v1.2.1
v1.2.0
New Interfaces
- Add
FileDownloader#insureServiceBind()
: Easy to block the current thread, and start FileDownloader service, after the service started then executes the request which needs the service alive. Refs #324. - Add
FileDownloader#insureServiceBindAsync()
: Easy to start FileDownloader service, and after the service started then executes the request which needs the service alive. Refs #324. - Add
FileDownloader#bindService(runnable:Runnable)
: Easy to start FileDownloader service, and after the service started then executes therunnable
. Refs #324. - Add
FileDownloader#init(Context,InitCustomMaker)
: Easy to initialize the FileDownloader engine with various kinds of customized components.
Enhancement
- Improve Practicability(
InitCustomMaker#database
): Support customize the database component with the implementation ofFileDownloadDatabase
, and implements the default database component:DefaultDatabaseImpl
. - Improve Practicability(
InitCustomMaker#outputStreamCreator
): Support customize the output stream with the implementation ofFileDownloadOutputStream
, and implements the default output stream componentFileDownloadRandomAccessFile
, and some alternative components:FileDownloadBufferedOutputStream
、FileDownloadOkio
.
v1.1.5
New Interfaces
- Support the configuration
file.non-pre-allocation
infiledownloader.properties
: Whether doesn't need to pre-allocates the 'content-length' space when to start downloading, default isfalse
. Closes #313 .
Fix
- Fix(fatal-crash): fix occur the
StackOverflowError
when thread pool getActiveCount is not right because of it just an approximate number. Closes #321 . - Fix(minor-crash): fix in some minor cases occur
IllegalStateException
which message is 'No reused downloaded file in this message'. Closes #316 . - Fix(minor-crash): fix when there are several serial-queues started in case of the FileDownloader service doesn't connect yet and in minor cases that the same task in the queue will be started twice which lead to crash. Refs #282 .
Others
v1.1.0
New Interfaces
- Add
BaseDownloadTask#setWifiRequired
: Set whether the task only allows downloading on the wifi network type. Defaultfalse
. Closes #281 .
Enhancement
- Improve Performance: Alternate all thread pools to exceed-wait-pool(more detail: docs in
FileDownloadExecutors
) and all threads in pools will be terminate after idle 5 second. Refs #303 . - Improve Practicability: Handle any
Throwable
s thrown onFileDownloadListener#blockComplete
method and callback toFileDownloadListener#error
method instead ofFileDownloadListener#completed
. Closes #305 .
Fix
- Fix(lost-connect): Prevent the waiting-connect-list contains duplicate tasks in minor cases.
v1.0.2
v1.0.1
New Interfaces
If you used
BaseDownloadTask#ready()
which is a deprecated method now, just migrate it toBaseDownloadTask#asInQueueTask():InQueueTask
andInQueueTask#enqueue()
.
- Add
BaseDownloadTask#asInQueueTask():InQueueTask
and DeprecatedBaseDownloadTask#ready()
: Declare the task is a queue task, what will be assembled by a queue which makes up of the samelistener
task and there is a methodInQueueTask#enqueue()
to enqueue this task to the global queue to ready for being assembled by the queue. The operation of methodInQueueTask#enqueue()
is the same to the Deprecated methodBaseDownloadTask#ready()
, we wrap theready()
method in this way just want you to know clearly: Only if the task belongs to a queue, you need to invoke this method otherwise if this task is an isolated task but you invoke this method, it's wrong and you will receive an exception(More detail reason please move to the exception thrown inDownloadTask#start
).
Fix
- Fix: Maybe occur an IllegalStateException when there are several isolated tasks and queues with the same
listener
object, and they are started in the different thread simultaneously. Closes #282 .
v1.0.0
New Interfaces
- Add
BaseDownloadTask#cancel
: This method is used for explaining why the pause operation is the same as the cancel operation.
Enhancement
- Improve Performance: Hold the result of
isDownloaderProcess
. - Improve Practicability: Refactor the visible layer of the code. Closes #283
- Improve Practicability: Perfect the java doc. Closes #284
- Improve Practicability: Add the java doc website: http://fd.dreamtobe.cn. Closes #285