| | |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.time.Duration; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName()); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8"); |
| | | OssClient storage = OssFactory.instance(sysOss.getService()); |
| | | long contentLength = storage.download(sysOss.getFileName(), response.getOutputStream()); |
| | | response.setContentLengthLong(contentLength); |
| | | storage.download(sysOss.getFileName(), response.getOutputStream(), response::setContentLengthLong); |
| | | } |
| | | |
| | | /** |