mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 03:27:49 +08:00
java-sdk添加文件下载示例
This commit is contained in:
@@ -210,9 +210,9 @@ public class OpenClient {
|
|||||||
protected FileResult buildFileResult(Response response) {
|
protected FileResult buildFileResult(Response response) {
|
||||||
FileResult fileResult = new FileResult();
|
FileResult fileResult = new FileResult();
|
||||||
Headers headers = response.headers();
|
Headers headers = response.headers();
|
||||||
InputStream inputStream = response.body().byteStream();
|
|
||||||
try {
|
try {
|
||||||
fileResult.setFileData(FileUtil.toBytes(inputStream));
|
byte[] bytes = response.body().bytes();
|
||||||
|
fileResult.setFileData(bytes);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("文件不存在", e);
|
log.error("文件不存在", e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user