Class DreamFileProxyFactory

java.lang.Object
cn.dreamfame.core.boot.file.DreamFileProxyFactory
All Implemented Interfaces:
IFileProxy

public class DreamFileProxyFactory extends Object implements IFileProxy
Author:
dreamfame
  • Constructor Details

    • DreamFileProxyFactory

      public DreamFileProxyFactory()
  • Method Details

    • rename

      public File rename(File f, String path)
      Description copied from interface: IFileProxy
      文件重命名策略
      Specified by:
      rename in interface IFileProxy
      Parameters:
      f - 文件
      path - 路径
      Returns:
      File
    • path

      public String[] path(File f, String dir)
      Description copied from interface: IFileProxy
      返回路径[物理路径][虚拟路径]
      Specified by:
      path in interface IFileProxy
      Parameters:
      f - 文件
      dir - 目录
      Returns:
      String
    • getFileExt

      public static String getFileExt(String fileName)
      获取文件后缀
      Parameters:
      fileName - 文件名
      Returns:
      文件后缀
    • getFileDir

      public static String getFileDir(String dir, String saveDir)
      获取文件保存地址
      Parameters:
      dir - 目录
      saveDir - 保存目录
      Returns:
      地址
    • compress

      public void compress(String path)
      图片压缩
      Specified by:
      compress in interface IFileProxy
      Parameters:
      path - 文件地址