Skip to content

Commit

Permalink
#295 修复临时文件关闭
Browse files Browse the repository at this point in the history
* update travis settings

* feat(okhttp): 修改okhttp底层调用方法

直接用OkHttpClient代替connect.使客户端单一化.Okhttp 自动管理连接池优化

* feat(log,jsApi): 添加log debug 标记明确下调用底层效果,修复jsAPI Lock 为null 问题

添加log debug 标记明确下调用底层效果,修复jsAPI Lock 为null 问题

#293

* fix(File): 修复文件关闭

修复文件关闭

* Update OkHttpMediaDownloadRequestExecutor.java
  • Loading branch information
dylanleung authored and binarywang committed Sep 2, 2017
1 parent 111196b commit 7a374c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static File createTmpFile(InputStream inputStream, String name, String ex
tmpFile = File.createTempFile(name, '.' + ext, tmpDirFile);
}

// tmpFile.deleteOnExit();
tmpFile.deleteOnExit();

try (FileOutputStream fos = new FileOutputStream(tmpFile)) {
int read = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public File execute(String uri, String queryParam) throws WxErrorException, IOEx
try (BufferedSink sink = Okio.buffer(Okio.sink(file))) {
sink.writeAll(response.body().source());
}
file.deleteOnExit();
return file;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public File execute(String uri, WxMpQrCodeTicket data) throws WxErrorException,
try (BufferedSink sink = Okio.buffer(Okio.sink(temp))) {
sink.writeAll(response.body().source());
}
temp.deleteOnExit();

return temp;
}
}

0 comments on commit 7a374c0

Please sign in to comment.