接口 FileOperateSpi
- 所有已知实现类:
LoadBalanceFileOperateSpi
public interface FileOperateSpi
文件操作提供者定义,由第三方实现文件管理功能,包括:上传、下载、获取文件信息等。
- 作者:
- 时克英
-
方法概要
修饰符和类型方法说明clearCdnPrefix(String path) 清除给定文件地址的CDN前缀。获取上传文件的CDN地址,根据使用的不同第三方服务从配置中查找。com.walker.file.FileInfogetFileInfo(long id) List<com.walker.file.FileInfo>getFileInfoList(List<String> ids) 返回本地文件系统存储根目录,如: d:/tmp/boolean调用远程上传文件,是否按照本地方式处理。com.walker.file.FileInfo[]uploadFileToFtp(InputStream[] inputStream, String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner) com.walker.file.FileInfouploadFileToFtp(InputStream inputStream, String fileName, String groupId, long fileSize) 已过时。com.walker.file.FileInfouploadFileToFtp(InputStream inputStream, String fileName, String groupId, long fileSize, Integer businessType, String owner) com.walker.file.FileInfo[]uploadFileToLocal(InputStream[] inputStream, String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner) com.walker.file.FileInfouploadFileToLocal(InputStream inputStream, String fileName, String groupId, long fileSize, Integer businessType, String owner) com.walker.file.FileInfo[]uploadFileToOss(InputStream[] inputStream, String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner, com.walker.file.FileStoreType ossType) com.walker.file.FileInfouploadFileToOss(InputStream inputStream, String fileName, String groupId, long fileSize, Integer businessType, String owner, com.walker.file.FileStoreType ossType) com.walker.file.FileInfouploadFileToSystem(InputStream inputStream, String fileName, String groupId, long fileSize) 已过时。
-
方法详细资料
-
clearCdnPrefix
清除给定文件地址的CDN前缀。如:https://qnyun.com/oss/12345678去掉前缀后,只剩下"12345678"- 参数:
path- 给定的文件资源地址- 返回:
-
getCdnUrl
String getCdnUrl()获取上传文件的CDN地址,根据使用的不同第三方服务从配置中查找。- 返回:
-
uploadFileToLocal
com.walker.file.FileInfo uploadFileToLocal(InputStream inputStream, String fileName, String groupId, long fileSize, Integer businessType, String owner) throws Exception - 抛出:
Exception
-
uploadFileToLocal
com.walker.file.FileInfo[] uploadFileToLocal(InputStream[] inputStream, String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner) throws Exception - 抛出:
Exception
-
uploadFileToFtp
com.walker.file.FileInfo uploadFileToFtp(InputStream inputStream, String fileName, String groupId, long fileSize, Integer businessType, String owner) throws Exception - 抛出:
Exception
-
uploadFileToFtp
com.walker.file.FileInfo[] uploadFileToFtp(InputStream[] inputStream, String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner) throws Exception - 抛出:
Exception
-
uploadFileToOss
com.walker.file.FileInfo uploadFileToOss(InputStream inputStream, String fileName, String groupId, long fileSize, Integer businessType, String owner, com.walker.file.FileStoreType ossType) throws Exception - 抛出:
Exception
-
uploadFileToOss
com.walker.file.FileInfo[] uploadFileToOss(InputStream[] inputStream, String[] fileName, String groupId, long[] fileSize, Integer businessType, String owner, com.walker.file.FileStoreType ossType) throws Exception - 抛出:
Exception
-
uploadFileToSystem
@Deprecated com.walker.file.FileInfo uploadFileToSystem(InputStream inputStream, String fileName, String groupId, long fileSize) throws Exception 已过时。- 抛出:
Exception
-
uploadFileToFtp
@Deprecated com.walker.file.FileInfo uploadFileToFtp(InputStream inputStream, String fileName, String groupId, long fileSize) throws Exception 已过时。- 抛出:
Exception
-
getFileInfo
com.walker.file.FileInfo getFileInfo(long id) -
getFileInfoList
-
getFileRootConfig
String getFileRootConfig()返回本地文件系统存储根目录,如: d:/tmp/- 返回:
-
isRemoteAsLocal
boolean isRemoteAsLocal()调用远程上传文件,是否按照本地方式处理。1)该选项为了适应没有FTP等服务的情况,特别是在开发过程,如果设置为:true 则调用远程上传方法后文件仍然保存在本地。 2)如果生产环境存在合适的文件存储服务,则需要设置为:false- 返回:
-