wlfcolin / file-downloader Goto Github PK
View Code? Open in Web Editor NEWFileDownloader, powerful http/https file download tool on Android
License: Apache License 2.0
FileDownloader, powerful http/https file download tool on Android
License: Apache License 2.0
System.err: org.wlf.filedownloader.file_download.file_saver.FileSaver$FileSaveException: saving data error!
08-24 10:39:28.686 14381-14512/com.fenqile.licai W/System.err: at org.wlf.filedownloader.file_download.file_saver.FileSaver.saveData(FileSaver.java:249)
08-24 10:39:28.687 14381-14512/com.fenqile.licai W/System.err: at org.wlf.filedownloader.file_download.DownloadTaskImpl.onDownloadConnected(DownloadTaskImpl.java:503)
08-24 10:39:28.687 14381-14512/com.fenqile.licai W/System.err: at org.wlf.filedownloader.file_download.http_downloader.HttpDownloader.notifyDownloadConnected(HttpDownloader.java:343)
08-24 10:39:28.687 14381-14512/com.fenqile.licai W/System.err: at org.wlf.filedownloader.file_download.http_downloader.HttpDownloader.download(HttpDownloader.java:297)
08-24 10:39:28.687 14381-14512/com.fenqile.licai W/System.err: at org.wlf.filedownloader.file_download.DownloadTaskImpl.run(DownloadTaskImpl.java:362)
08-24 10:39:28.687 14381-14512/com.fenqile.licai W/System.err: at org.wlf.filedownloader.file_download.RetryableDownloadTaskImpl.run(RetryableDownloadTaskImpl.java:465)
by invoking FileDownloader.getDownloadFile("some url).getDownloadedSizeLong(); befor starting download ,app gets crash and this is specific that getDownloadedSizeLong() is not initialized ! this should give 0 befor downloading not null!
有些时候下载url会附带一些参数信息,希望在FileDownloader.start()加入(Object object)参数,这个参数可以通过DownloadFileInfo获取到,这样的话,在下载监听的地方就可以获取到此参数信息了。
可以自己设置更新进度回调的时间,目前看默认是2s,希望可以自定义。
看到还有一种更新策略是根据大小,也希望改成可以设置的方式。
有没有方法可以强行重新下载url没变的文件?
hi
thank you for your downloader
on api 23 i got a SPACE_FULL error, but my phone space is full, it's works on api <23
what should i do ?
thanks in advance,
hi , your library supported chunking file ? i need download one task in 4 or 5 thread in same time
请问支持断点上传文件吗?我说的是上传文件不是下载文件
使用该库从七牛云存储上下载资源的话,文件名无法正常保存,总会保存成: "filename.sub" (包含了两边的引号),下载中的临时文件就是; "finame.sub".temp
测试地址:http://od6crdcrj.bkt.clouddn.com/VR%E7%94%B5%E5%BD%B1.jpg
解决方法:必须调用FileDownloader.delete()来删除文件。为什么会这样呢?
你好,麻烦问下实现你的监听后,listview的进度条会被复用,我可以在我的holder里面获取到进度条的进度么,还是只能在监听里获得
对于受限制的下载资源,例如url需要添加登陆信息,在header中添加信息等等情况有相应的处理方法吗?我使用MultiBuilder.addHeaderWithUrl()添加头,但是不起作用,探测文件一直是失败的
D/RetryableDownloadTaskImpl: RetryableDownloadTaskImpl.stop 结束任务执行(其它线程发起),url:http://m.Tencent.com/download/index.html,是否已经暂停:true
这个是什么意思?
如果配置了能够同时下载的任务数为2个,当我添加第三个下载任务后,这个时候处于等待中状态,再把它取消掉(调用FileDownloader的delete方法),然后再添加那个被取消的下载任务,此时收不到下载状态更新的回调,DownloadFileInfo里的状态信息Status为DOWNLOAD_STATUS_UNKNOWN
`public Builder configFileDownloadDir(String fileDownloadDir) {
if (!TextUtils.isEmpty(fileDownloadDir)) {
File file = new File(fileDownloadDir);
if (!file.exists()) {
Log.i(TAG, "configFileDownloadDir 要设置的文件下载保存目录:" + fileDownloadDir + " 还不存在,需要创建!");
boolean isCreateSuccess = file.mkdirs();
if (isCreateSuccess) {
Log.i(TAG, "configFileDownloadDir 要设置的文件下载保存目录:" + fileDownloadDir + " 创建成功!");
} else {
Log.i(TAG, "configFileDownloadDir 要设置的文件下载保存目录:" + fileDownloadDir + " 创建失败!");
}
} else {
Log.i(TAG, "configFileDownloadDir 要设置的文件下载保存目录:" + fileDownloadDir + " 已存在,不需要创建!");
}
this.mFileDownloadDir = fileDownloadDir;
}
return this;
}`
isCreateSuccess总是返回失败
what means?
无法切换暂停/开始/等待中的装态
在下载过程中,我需要先后添加多个目标文件进行下载,请问如何才能实现?
hey there and thanx for the useful lib
im using api 24 and It seams the lib is deprecated on thise api
what is the solution of FileDownloader is deprecated ?
加上m3u8文件的下载合并就独一无二了....
比如 优酷....
创建200+个任务概率性出现以下问题:
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:788)
at java.util.HashMap$ValueIterator.next(HashMap.java:820)
at java.util.AbstractCollection.toArrayList(AbstractCollection.java:349)
at java.util.AbstractCollection.toArray(AbstractCollection.java:339)
at java.util.ArrayList.(ArrayList.java:97)
at
org.wlf.filedownloader.DownloadCacher.getDownloadFiles(DownloadCacher.java:669)
at
org.wlf.filedownloader.file_download.DownloadTaskManager.checkFileNameInternal(DownloadTaskManager.java:628)
at
org.wlf.filedownloader.file_download.DownloadTaskManager.checkFileName(DownloadTaskManager.java:622)
at
org.wlf.filedownloader.file_download.DownloadTaskManager.createAndStart(DownloadTaskManager.java:610)
at
org.wlf.filedownloader.FileDownloadManager.createAndStart(FileDownloadManager.java:384)
at
org.wlf.filedownloader.FileDownloader.createAndStart(FileDownloader.java:323)
at
DownloadUtils$DownloadThread.run(DownloadUtils.java:242)
FileDownloader.detect(apkUrl, new OnDetectBigUrlFileListener() {
@OverRide
public void onDetectNewDownloadFile(String url, String fileName, String saveDir, long fileSize) {
// 如果有必要,可以改变文件名称fileName和下载保存的目录saveDir
FileDownloader.createAndStart(url, savePath, saveFileName);
}
@OverRide
public void onDetectUrlFileExist(String url) {
// 继续下载,自动会断点续传(如果服务器无法支持断点续传将从头开始下载)
FileDownloader.start(url);
}
@OverRide
public void onDetectUrlFileFailed(String url, DetectBigUrlFileFailReason failReason) {
// 探测一个网络文件失败了,具体查看failReason
}
});
这个好像也不起作用.....如何设置呢?
可以直接下载文件到data/data/appname/ 这个下面吗?怎么实现
你好,博主,下载同样路径的不同文件时会报这个异常,不知是否程序内部做了限制?下载链接是一样的,但是文件大小不同,因为我只是在后台替换了文件,就导致了无法下载。麻烦解答下我的问题,谢谢
Some files with space in their name can not be downloaded. I have tried using Url Encoding but that does not helps. I can download these file using Firefox or Chrome on PC.
E/wlf: getEncodedUrl,编码后URL,encodedUrl:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
D/wlf: getEncodedUrl,--------------------
D/wlf: getEncodedUrl,准备编码URL,url:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
D/wlf: getEncodedUrl,开始编码URL,unEncodeUrl:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
D/wlf: getEncodedUrl,开始编码URL,getProtocol:http
D/wlf: getEncodedUrl,开始编码URL,getHost:m1.daumcdn.net
D/wlf: getEncodedUrl,开始编码URL,getUserInfo:null
D/wlf: getEncodedUrl,开始编码URL,getPort:-1
D/wlf: getEncodedUrl,开始编码URL,getFile:/svc/image/U03/cartoon/576A133F0162930001
D/wlf: getEncodedUrl,开始编码URL,getPath:/svc/image/U03/cartoon/576A133F0162930001
D/wlf: getEncodedUrl,开始编码URL,getQuery:null
D/wlf: getEncodedUrl,开始编码URL,getRef:null
D/wlf: isEncoded,check content:m1.daumcdn.net
D/wlf: isEncoded,check content:svc
D/wlf: isEncoded,check content:image
D/wlf: isEncoded,check content:U03
D/wlf: isEncoded,check content:cartoon
D/wlf: isEncoded,check content:576A133F0162930001
E/wlf: getEncodedUrl,编码后URL,encodedUrl:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
I/DownloadStatusObserver: file-downloader-listener 通知【文件下载状态为完成】,文件的url:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
I/RetryableDownloadTaskImpl: file-downloader-status 记录【完成状态】成功,url:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
E/DownloadTaskManager: mRunningDownloadTaskMap,--移除--:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001,task:1065054617,线程数:69
D/RetryableDownloadTaskImpl: RetryableDownloadTaskImpl.run 文件下载任务【已结束】,是否有异常:false,url:http://m1.daumcdn.net/svc/image/U03/cartoon/576A133F0162930001
同一个下载源,其他方式下载很快(3~4M /s )。 楼主这个方式下载速度只有500kb左右。请问是什么原因。
正常下载过程中爆出来的,然后在继续又开始断点继续下载了。
希望能支持FTP下载
有些网站需要HTTP登录后才能访问,请问应该怎么做?
如题
每次下载调用的是 FileDownloader.start(downloadUrl);
手动删除下载好的 apk后,debug 发现 报 416错误
下载百度找的其他的正常,下载阿里云中的断点下载就会失效,暂停后再点击开始就会从头开始下载
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:772)
at org.wlf.filedownloader.file_download.DownloadTaskManager.getRunningDownloadTask(DownloadTaskManager.java:183)
at org.wlf.filedownloader.file_download.DownloadTaskManager.getRunningDownloadTask(DownloadTaskManager.java:166)
at org.wlf.filedownloader.file_download.DownloadTaskManager.isDownloading(DownloadTaskManager.java:836)
at org.wlf.filedownloader.file_download.DownloadTaskManager.notifyDownloadStatusFailed(DownloadTaskManager.java:434)
at org.wlf.filedownloader.file_download.DownloadTaskManager.access$500(DownloadTaskManager.java:45)
at org.wlf.filedownloader.file_download.DownloadTaskManager$5.onDetectUrlFileFailed(DownloadTaskManager.java:736)
at org.wlf.filedownloader.listener.OnDetectBigUrlFileListener$MainThreadHelper$3.run(OnDetectBigUrlFileListener.java:114)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5551)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
hi. i use your Library in my App. when i want to redownload a file , Unfortunately only downloaded it and not store that file.
博主你好:
private static String getEncodedFile(String path, String query, String ref, String charset, EncodeInfo[] specials)
这个方法对于只有一个参数的接口会出错,如:http://192.168.12.14/app/client/device/downloadapp?fileId=Z3JvdXAxL00wMC8wMC81MS9DbThNRGx0Unk2NkVMV3,经过这个方法以后问号会丢失。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.