类 AliyunOssFileStorageServiceImpl
java.lang.Object
com.diboot.file.service.impl.AliyunOssFileStorageServiceImpl
- 所有已实现的接口:
FileStorageService
@Service("fileStorageService")
@ConditionalOnClass(com.aliyun.oss.OSSClientBuilder.class)
@ConditionalOnProperty(prefix="diboot.file.oss.aliyun",
name={"endpoint","access-key-id","access-key-secret"})
public class AliyunOssFileStorageServiceImpl
extends Object
implements FileStorageService
阿里云OSS
- 版本:
- : v3.0.0
- 作者:
- : wind
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean删除文件voiddestroy()voiddownload(FileRecord fileRecord, jakarta.servlet.http.HttpServletResponse response) 获取文件获取文件voidinit()private Stringsave(InputStream inputStream, String fileName) save(InputStream inputStream, String fileName, long size) 上传文件save(org.springframework.web.multipart.MultipartFile file) 上传文件从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 com.diboot.file.service.FileStorageService
buildAccessUrl, save
-
字段详细资料
-
fileProperties
-
ossClient
private com.aliyun.oss.OSS ossClient
-
-
构造器详细资料
-
AliyunOssFileStorageServiceImpl
public AliyunOssFileStorageServiceImpl()
-
-
方法详细资料
-
init
@PostConstruct public void init() -
destroy
@PreDestroy public void destroy() -
save
从接口复制的说明:FileStorageService上传文件- 指定者:
save在接口中FileStorageService- 返回:
- 抛出:
Exception
-
save
从接口复制的说明:FileStorageService上传文件- 指定者:
save在接口中FileStorageService- 返回:
- 抛出:
Exception
-
save
-
getFile
从接口复制的说明:FileStorageService获取文件- 指定者:
getFile在接口中FileStorageService- 参数:
filePath- 文件路径- 返回:
- 抛出:
Exception
-
download
public void download(FileRecord fileRecord, jakarta.servlet.http.HttpServletResponse response) throws Exception 从接口复制的说明:FileStorageService获取文件- 指定者:
download在接口中FileStorageService- 抛出:
Exception
-
delete
从接口复制的说明:FileStorageService删除文件- 指定者:
delete在接口中FileStorageService- 参数:
filePath- 文件路径- 返回:
- 是否删除成功
-