如何下载合并分割的小文件?
- 内容介绍
- 相关推荐
本文共计290个文字,预计阅读时间需要2分钟。
合并分割后的文件,使用GET方法,直接输出结果:`合并分割后的文件,@ApiOperation(value=合并下载文件, notes=合并下载文件, httpMethod=GET, produces=MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value=/mergePartFiles, method=RequestMethod.GET) pu`
合并分割后的小文件@ApiOperation(value = "合并下载文件", notes = "合并下载文件", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/mergePartFiles", method = RequestMethod.GET)
public void mergePartFiles(HttpServletResponse response, String fileName){
Token token = ConcurrentHashMapUtil.getToken(osv3Params.getToken());
if (StringUtils.isEmpty(token)){
//手动认证
AuthenticateHandler.start(osv3Params);
token = ConcurrentHashMapUtil.getToken(osv3Params.getToken());
}
try {
//创建临时文件
File tempFile = File.createTempFile(fileName, null);
OSClient.OSClientV3 clientV3 = OSFactory.clientFromToken(token);
List
list = clientV3.objectStorage().objects().list("part");
//创建输出流。
BufferedOutputStream bosFinal= new BufferedOutputStream(
new FileOutputStream(tempFile));
//构建流集合。
Vector
本文共计290个文字,预计阅读时间需要2分钟。
合并分割后的文件,使用GET方法,直接输出结果:`合并分割后的文件,@ApiOperation(value=合并下载文件, notes=合并下载文件, httpMethod=GET, produces=MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value=/mergePartFiles, method=RequestMethod.GET) pu`
合并分割后的小文件@ApiOperation(value = "合并下载文件", notes = "合并下载文件", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/mergePartFiles", method = RequestMethod.GET)
public void mergePartFiles(HttpServletResponse response, String fileName){
Token token = ConcurrentHashMapUtil.getToken(osv3Params.getToken());
if (StringUtils.isEmpty(token)){
//手动认证
AuthenticateHandler.start(osv3Params);
token = ConcurrentHashMapUtil.getToken(osv3Params.getToken());
}
try {
//创建临时文件
File tempFile = File.createTempFile(fileName, null);
OSClient.OSClientV3 clientV3 = OSFactory.clientFromToken(token);
List
list = clientV3.objectStorage().objects().list("part");
//创建输出流。
BufferedOutputStream bosFinal= new BufferedOutputStream(
new FileOutputStream(tempFile));
//构建流集合。
Vector

