Skip to content

Commit

Permalink
download file with work thread
Browse files Browse the repository at this point in the history
download file with work thread
  • Loading branch information
dupengtao committed Sep 16, 2015
1 parent a8bb750 commit f46bea5
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,20 @@ public FileAsyncHttpResponseHandler(File file, boolean append) {
* @param renameTargetFileIfExists whether target file should be renamed if it already exists
*/
public FileAsyncHttpResponseHandler(File file, boolean append, boolean renameTargetFileIfExists) {
super();
this(file,append,renameTargetFileIfExists,false);
}


/**
* Obtains new FileAsyncHttpResponseHandler and stores response in passed file
*
* @param file File to store response within, must not be null
* @param append whether data should be appended to existing file
* @param renameTargetFileIfExists whether target file should be renamed if it already exists
* @param usePoolThread Whether to use the pool's thread to fire callbacks
*/
public FileAsyncHttpResponseHandler(File file, boolean append, boolean renameTargetFileIfExists,boolean usePoolThread) {
super(usePoolThread);
Utils.asserts(file != null, "File passed into FileAsyncHttpResponseHandler constructor must not be null");
if (!file.isDirectory() && !file.getParentFile().isDirectory()) {
Utils.asserts(file.getParentFile().mkdirs(), "Cannot create parent directories for requested File location");
Expand Down

0 comments on commit f46bea5

Please sign in to comment.