zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
 
package org.jeecg.modules.doc.component;
 
import com.aliyun.oss.OSS;
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.jeecg.modules.doc.vo.DownloadFile;
 
public abstract class Downloader {
    public Downloader() {
    }
 
    public void download(HttpServletResponse httpServletResponse, DownloadFile downloadFile) {
        InputStream inputStream = this.getInputStream(downloadFile);
        ServletOutputStream outputStream = null;
        boolean var10 = false;
 
        OSS ossClient;
        label73: {
            try {
                var10 = true;
                outputStream = httpServletResponse.getOutputStream();
                IOUtils.copyLarge(inputStream, outputStream);
                var10 = false;
                break label73;
            } catch (IOException var11) {
                var11.printStackTrace();
                var10 = false;
            } finally {
                if (var10) {
                    IOUtils.closeQuietly(inputStream);
                    IOUtils.closeQuietly(outputStream);
                    ossClient = downloadFile.getOssClient();
                    if (ossClient != null) {
                        ossClient.shutdown();
                    }
 
                }
            }
 
            IOUtils.closeQuietly(inputStream);
            IOUtils.closeQuietly(outputStream);
            ossClient = downloadFile.getOssClient();
            if (ossClient != null) {
                ossClient.shutdown();
            }
 
            return;
        }
 
        IOUtils.closeQuietly(inputStream);
        IOUtils.closeQuietly(outputStream);
        ossClient = downloadFile.getOssClient();
        if (ossClient != null) {
            ossClient.shutdown();
        }
 
    }
 
    public abstract InputStream getInputStream(DownloadFile downloadFile);
}