Filedownloader: 你好,我想问下2个文件有着相同的文件名,但是大小不一样,为什么会直接返回已下载完成?

Created on 2 Dec 2016  ·  4Comments  ·  Source: lingochamp/FileDownloader

你好,我想问下2个文件有着相同的文件名,但是大小不一样,差别在1K以内,为什么会直接返回已下载完成?
我之前有一个文件存了10张图和一个文本文件打了个zip,之后我在文本文件里添加了些文字重新打了zip,他们的下载地址是不一样的。但是如果本地已存在文件1,当我试图下载文件2的时候,会直接返回已下载完成,请问这种问题如何解决?

question

Most helpful comment

如果某路径存在文件,默认情况下是直接返回完成的,与相差大小无关。

解决

如果希望始终不关心本地已经存在的文件,可以通过BaseDownloadTask#setForceReDownload(true),强制覆盖本地已经存在的文件即可。

All 4 comments

如果某路径存在文件,默认情况下是直接返回完成的,与相差大小无关。

解决

如果希望始终不关心本地已经存在的文件,可以通过BaseDownloadTask#setForceReDownload(true),强制覆盖本地已经存在的文件即可。

谢谢

如果强制设置这个属性的话,会不会影响断点续传呢

@56858752 不会的。

可以参考下java-doc:

/**
 * Force re-downloading the file regardless the target file is exist.
 *
 * @param isForceReDownload If set to true, will not check whether the target file is exist.
 *                          <p>
 *                          Default: {@code false}.
 */
BaseDownloadTask setForceReDownload(final boolean isForceReDownload);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndyGu picture AndyGu  ·  3Comments

itsmallsun picture itsmallsun  ·  4Comments

hu499019771 picture hu499019771  ·  3Comments

seransaca picture seransaca  ·  5Comments

bluemix picture bluemix  ·  4Comments