Class MGL_FileIOUtils

java.lang.Object
tech.mgl.core.utils.MGL_FileIOUtils

public class MGL_FileIOUtils extends Object
  • Field Details

  • Constructor Details

    • MGL_FileIOUtils

      public MGL_FileIOUtils()
  • Method Details

    • generatorFileName

      public static String generatorFileName(String fileName)
      生成新文件名,自动判断类型
      Parameters:
      fileName -
      Returns:
    • generatorFileName

      public static String generatorFileName(String fileName, int key)
    • checkImgType

      public static boolean checkImgType(String type)
      检查上传图片类型
      Parameters:
      type - 检查的文件类型如 jpg ,doc 等
      Returns:
    • checkVideoType

      public static boolean checkVideoType(String type)
      检查上传视频类型
      Parameters:
      type - 检查的文件类型如 jpg ,doc 等
      Returns:
    • checkType

      public static boolean checkType(String type)
      检查上传文件类型
      Parameters:
      type - 检查的文件类型如 jpg ,doc 等
      Returns:
    • check

      public static boolean check(String type, String extKey)
      指定校验类型 @Title: check @Description: TODO(这里用一句话描述这个方法的作用) @param type @param propName @return 参数 @author www.mgl.tech @date 2016年6月8日 下午12:14:53 @return boolean 返回类型 @throws
    • getEndWithSlashPath

      public static String getEndWithSlashPath(String path)
      获取完整路径,就是检查结尾有无斜杠,没有则自动加斜杠
      Parameters:
      path - 路径
      Returns:
    • getStartWithSlashPath

      public static String getStartWithSlashPath(String path)
      获取完整路径,就是检查结开头无斜杠,没有则自动加斜杠
      Parameters:
      path -
      Returns:
    • getPathWithSlashPath

      public static String getPathWithSlashPath(String path)
      如果没用则 前后依次判断加斜杠
      Parameters:
      path -
      Returns:
    • getRelativePath

      public static String getRelativePath(String pattern)
    • getUploadPath

      public static String getUploadPath(String fileName)
      get upload path
      Parameters:
      fileName - fileName
      Returns:
      String
    • getRelativePath

      public static String getRelativePath()
      返回格式为 年/月
      Returns:
    • copyFileFromJar

      public static File copyFileFromJar(String src)
    • copyFileFromJar

      public static File copyFileFromJar(Class<?> cls, String src)
    • copyFileFromJar

      public static File copyFileFromJar(Class<?> cls, String src, String dest)
    • main

      public static void main(String[] args)