shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.walker.file;
 
import java.io.InputStream;
import java.util.List;
 
public interface FileOperateEngine {
 
    /**
     * 关闭引擎。
     */
    void close();
 
    /**
     * 上传文件操作
     * @param inputStream 文件流
     * @param fileName 文件名称,如: demo.txt
     * @param groupId 分组ID,即: 业务ID
     * @return
     * @throws FileOperateException
     * @date 已废弃,请使用新方法:{@linkplain FileOperateEngine#uploadFile(InputStream, String, String, long, Integer, String)}
     */
    @Deprecated
    FileInfo uploadFile(InputStream inputStream, String fileName, String groupId, long fileSize) throws FileOperateException;
 
    /**
     * 文件上传
     * @param inputStream
     * @param fileName 文件名称,如: demo.txt
     * @param groupId
     * @param fileSize 文件大小
     * @param businessType 业务分类(PID),为空表示不存在系统默认:-1
     * @param owner 数据归属(商户ID)
     * @return
     * @throws FileOperateException
     * @date 2023-06-09
     */
    FileInfo uploadFile(InputStream inputStream
            , String fileName, String groupId, long fileSize, Integer businessType, String owner) throws FileOperateException;
 
    /**
     * 多个文件上传
     * @param inputStream
     * @param fileName
     * @param groupId
     * @param fileSize
     * @param businessType
     * @param owner
     * @return 返回多个文件结果集合
     * @throws FileOperateException
     * @date 2023-08-01
     */
    FileInfo[] uploadFile(InputStream[] inputStream
            , String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner) throws FileOperateException;
 
    FileInfo uploadFile(String filePath, String groupId) throws FileOperateException;
 
    /**
     * 下载单个文件,该方法适用于中小型文件,大文件需要其他方式处理。
     * @param id 文件id
     * @return 返回文件二进制数据
     * @throws FileOperateException
     */
    byte[] downloadFile(String id) throws FileOperateException;
 
    /**
     * 返回文件基本信息
     * @param id 文件id
     * @return
     * @date 2023-02-14
     */
    FileInfo getFileInfo(String id);
 
    /**
     * 返回给定多个文件的集合。
     * @param ids
     * @return
     * @date 2023-02-14
     */
    List<FileInfo> getFileInfoList(List<String> ids);
 
    /**
     * 返回文件存储类型。
     * @return
     */
    FileStoreType getFileStoreType();
 
    /**
     * 设置文件存储的根目录,如: /rootFile
     * @param rootName
     */
    void setFileRoot(String rootName);
}