megre
This commit is contained in:
@@ -62,6 +62,18 @@ public class DownloadTarget
|
||||
mTaskEntity.refreshInfo = refreshInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否使用服务器通过content-disposition传递的文件名,内容格式{@code attachment;filename=***}
|
||||
* 如果获取不到服务器文件名,则使用用户设置的文件名
|
||||
* 只适用于HTTP请求
|
||||
*
|
||||
* @param use {@code true} 使用
|
||||
*/
|
||||
@Deprecated public DownloadTarget useServerFileName(boolean use) {
|
||||
mTaskEntity.useServerFileName = use;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将任务设置为最高优先级任务,最高优先级任务有以下特点:
|
||||
* 1、在下载队列中,有且只有一个最高优先级任务
|
||||
|
||||
@@ -54,6 +54,7 @@ class HttpFileInfoThread implements Runnable {
|
||||
conn = ConnectionHelp.setConnectParam(mTaskEntity, conn);
|
||||
conn.setRequestProperty("Range", "bytes=" + 0 + "-");
|
||||
conn.setConnectTimeout(mConnectTimeOut);
|
||||
conn.setRequestMethod(mTaskEntity.requestEnum.name);
|
||||
conn.connect();
|
||||
handleConnect(conn);
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -168,7 +168,8 @@ public abstract class AbsTarget<TARGET extends AbsTarget, ENTITY extends AbsEnti
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求类型
|
||||
* 设置请求类型,POST或GET,默认为在GET
|
||||
* 只试用于HTTP请求
|
||||
*
|
||||
* @param requestEnum {@link RequestEnum}
|
||||
*/
|
||||
|
||||
@@ -105,6 +105,12 @@ public abstract class AbsTaskEntity<ENTITY extends AbsEntity> extends DbEntity {
|
||||
*/
|
||||
public String md5Key = "Content-MD5";
|
||||
|
||||
/**
|
||||
* 是否使用服务器通过content-disposition传递的文件名,内容格式{@code attachment;filename=***}
|
||||
* {@code true} 使用
|
||||
*/
|
||||
public boolean useServerFileName = false;
|
||||
|
||||
/**
|
||||
* 从header中获取文件描述信息所需要的key
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user