Skip to content

Commit f46bea5

Browse files
author
dupengtao
committed
download file with work thread
download file with work thread
1 parent a8bb750 commit f46bea5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

library/src/main/java/com/loopj/android/http/FileAsyncHttpResponseHandler.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,20 @@ public FileAsyncHttpResponseHandler(File file, boolean append) {
6363
* @param renameTargetFileIfExists whether target file should be renamed if it already exists
6464
*/
6565
public FileAsyncHttpResponseHandler(File file, boolean append, boolean renameTargetFileIfExists) {
66-
super();
66+
this(file,append,renameTargetFileIfExists,false);
67+
}
68+
69+
70+
/**
71+
* Obtains new FileAsyncHttpResponseHandler and stores response in passed file
72+
*
73+
* @param file File to store response within, must not be null
74+
* @param append whether data should be appended to existing file
75+
* @param renameTargetFileIfExists whether target file should be renamed if it already exists
76+
* @param usePoolThread Whether to use the pool's thread to fire callbacks
77+
*/
78+
public FileAsyncHttpResponseHandler(File file, boolean append, boolean renameTargetFileIfExists,boolean usePoolThread) {
79+
super(usePoolThread);
6780
Utils.asserts(file != null, "File passed into FileAsyncHttpResponseHandler constructor must not be null");
6881
if (!file.isDirectory() && !file.getParentFile().isDirectory()) {
6982
Utils.asserts(file.getParentFile().mkdirs(), "Cannot create parent directories for requested File location");

0 commit comments

Comments
 (0)