Package tech.mgl.core.utils
Class MGL_FileIOUtils
java.lang.Object
tech.mgl.core.utils.MGL_FileIOUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean指定校验类型 @Title: check @Description: TODO(这里用一句话描述这个方法的作用) @param type @param propName @return 参数 @author www.mgl.tech @date 2016年6月8日 下午12:14:53 @return boolean 返回类型 @throwsstatic booleancheckImgType(String type) 检查上传图片类型static boolean检查上传文件类型static booleancheckVideoType(String type) 检查上传视频类型static FilecopyFileFromJar(Class<?> cls, String src) static FilecopyFileFromJar(Class<?> cls, String src, String dest) static FilecopyFileFromJar(String src) static StringgeneratorFileName(String fileName) 生成新文件名,自动判断类型static StringgeneratorFileName(String fileName, int key) static StringgetEndWithSlashPath(String path) 获取完整路径,就是检查结尾有无斜杠,没有则自动加斜杠static StringgetPathWithSlashPath(String path) 如果没用则 前后依次判断加斜杠static String返回格式为 年/月static StringgetRelativePath(String pattern) static StringgetStartWithSlashPath(String path) 获取完整路径,就是检查结开头无斜杠,没有则自动加斜杠static StringgetUploadPath(String fileName) get upload pathstatic void
-
Field Details
-
GEN_IMAGE_NAME
public static final int GEN_IMAGE_NAME- See Also:
-
GEN_VIDEO_NAME
public static final int GEN_VIDEO_NAME- See Also:
-
GEN_OTHER_NAME
public static final int GEN_OTHER_NAME- See Also:
-
-
Constructor Details
-
MGL_FileIOUtils
public MGL_FileIOUtils()
-
-
Method Details
-
generatorFileName
生成新文件名,自动判断类型- Parameters:
fileName-- Returns:
-
generatorFileName
-
checkImgType
检查上传图片类型- Parameters:
type- 检查的文件类型如 jpg ,doc 等- Returns:
-
checkVideoType
检查上传视频类型- Parameters:
type- 检查的文件类型如 jpg ,doc 等- Returns:
-
checkType
检查上传文件类型- Parameters:
type- 检查的文件类型如 jpg ,doc 等- Returns:
-
check
指定校验类型 @Title: check @Description: TODO(这里用一句话描述这个方法的作用) @param type @param propName @return 参数 @author www.mgl.tech @date 2016年6月8日 下午12:14:53 @return boolean 返回类型 @throws -
getEndWithSlashPath
获取完整路径,就是检查结尾有无斜杠,没有则自动加斜杠- Parameters:
path- 路径- Returns:
-
getStartWithSlashPath
获取完整路径,就是检查结开头无斜杠,没有则自动加斜杠- Parameters:
path-- Returns:
-
getPathWithSlashPath
如果没用则 前后依次判断加斜杠- Parameters:
path-- Returns:
-
getRelativePath
-
getUploadPath
get upload path- Parameters:
fileName- fileName- Returns:
- String
-
getRelativePath
返回格式为 年/月- Returns:
-
copyFileFromJar
-
copyFileFromJar
-
copyFileFromJar
-
main
-