public class WebUtil extends Object
构造器和说明 |
---|
WebUtil() |
限定符和类型 | 方法和说明 |
---|---|
static void |
exportFile(File file,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
导出文件
|
static String |
getAppDir()
获取应用根目录
|
static String |
getCredentialsLoginID(String credentials,
String channel,
String appKey)
获取凭证登录标识
|
static String |
getReportPath(String dir,
String uuid,
String suffix)
报告文件路径
|
static String |
getTemplatePath(String id)
模板文件路径
|
static String |
getTemplateRulePath(String id)
模板规则文件路径
|
static String |
getTempPath(String dir,
String uuid,
String suffix)
临时文件路径
|
static String |
getUploadAttachmentPath(String dir,
String uploadAttachmentMark,
String suffix)
获取网站存放上传附件的路径
|
static String |
getUploadAvatarPath(String dir,
String uploadAvatarMark,
String suffix)
获取网站存放上传头像的路径
|
static String |
getUploadImagePath(String dir,
String uploadImageMark,
String suffix)
获取网站存放上传图片的路径
|
static String |
getUploadVideoPath(String dir,
String uploadVideoMark,
String suffix)
获取网站存放上传视频的路径
|
static boolean |
inWhiteList(String suffix)
判断文件格式是否在白名单中
|
static String |
readClassConfigFileContent(String classConfigFilePath)
读取类路径中的配置文件
|
public static String readClassConfigFileContent(String classConfigFilePath) throws IOException
classConfigFilePath
- 类路径中配置文件路径IOException
public static String getAppDir() throws FileNotFoundException
FileNotFoundException
public static boolean inWhiteList(String suffix) throws IOException
suffix
- 文件格式后缀IOException
public static String getUploadImagePath(String dir, String uploadImageMark, String suffix)
dir
- 业务数据目录uploadImageMark
- 图片名称suffix
- 图片格式public static String getUploadVideoPath(String dir, String uploadVideoMark, String suffix)
dir
- 业务数据目录uploadVideoMark
- 视频名称suffix
- 视频格式public static String getUploadAvatarPath(String dir, String uploadAvatarMark, String suffix)
dir
- 业务数据目录uploadAvatarMark
- 头像名称suffix
- 头像格式public static String getUploadAttachmentPath(String dir, String uploadAttachmentMark, String suffix)
dir
- 业务数据目录uploadAttachmentMark
- 附件名称suffix
- 附件格式public static String getTempPath(String dir, String uuid, String suffix)
dir
- 业务数据目录uuid
- 文件名称suffix
- 文件格式public static String getReportPath(String dir, String uuid, String suffix)
dir
- 业务数据目录uuid
- 报告文件名称suffix
- 报告文件格式public static String getTemplateRulePath(String id)
id
- 模板IDpublic static String getCredentialsLoginID(String credentials, String channel, String appKey)
credentials
- 凭证channel
- 请求渠道appKey
- 应用标识public static void exportFile(File file, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
file
- request
- response
- IOException