类 FileServiceFastDFSImpl

java.lang.Object
io.github.mangocrisp.spring.taybct.tool.file.service.impl.FileServiceFastDFSImpl
所有已实现的接口:
IFileService

@Service @RefreshScope @AutoConfiguration public class FileServiceFastDFSImpl extends Object implements IFileService
FastDFS 文件存储
从以下版本开始:
1.0.0
  • 构造器详细资料

    • FileServiceFastDFSImpl

      public FileServiceFastDFSImpl()
  • 方法详细资料

    • upload

      public String upload(org.springframework.web.multipart.MultipartFile file) throws Exception
      从接口复制的说明: IFileService
      上传文件
      为了安全考虑,请不要把文件通过 nginx 代理的方式等方式让外面可以直接通过请求路径访问到,而是通过 get 方法去获取请求流回来,然后再做处理
      指定者:
      upload 在接口中 IFileService
      参数:
      file - 文件
      返回:
      文件上传成功之后的路径
      抛出:
      Exception
    • upload

      public String upload(org.springframework.web.multipart.MultipartFile file, String path, String filename) throws Exception
      从接口复制的说明: IFileService
      上传文件
      这个方法可以指定要上传到哪个路径去
      指定者:
      upload 在接口中 IFileService
      参数:
      file - 文件
      path - 路径
      filename - 文件名
      返回:
      上传后的路径
      抛出:
      Exception - 异常
    • upload

      public String upload(org.springframework.web.multipart.MultipartFile file, String groupName) throws Exception
      可以指定分组名来上传
      参数:
      file - 上传的文件
      groupName - 分组名
      返回:
      Boolean
      抛出:
      Exception
      从以下版本开始:
      1.0.0
    • delete

      public Boolean delete(String path) throws Exception
      从接口复制的说明: IFileService
      根据文件请求路径删除文件
      指定者:
      delete 在接口中 IFileService
      参数:
      path - 文件
      返回:
      删除是否成功
      抛出:
      Exception
    • delete

      public Boolean delete(String path, String groupName) throws Exception
      可以指定分组名来删除
      参数:
      path - 文件路径
      groupName - 分组名
      返回:
      Boolean
      抛出:
      Exception
      从以下版本开始:
      1.0.0
    • get

      public InputStream get(String path) throws Exception
      从接口复制的说明: IFileService
      根据文件请求路径获取文件,这里返回的是流
      指定者:
      get 在接口中 IFileService
      参数:
      path - 上传成功之后的请求路径
      返回:
      返回流,外部拿到流自行处理
      抛出:
      Exception
    • get

      public InputStream get(String path, String groupName) throws Exception
      可以指定分组名来下载
      参数:
      path - 文件路径
      groupName - 分组名
      返回:
      Boolean
      抛出:
      Exception
      从以下版本开始:
      1.0.0