类 ResServerUtil
java.lang.Object
com.sh.wf.module.component.common.ResServerUtil
Description:
Title:首亨软件 - TSS/CRM等
- 从以下版本开始:
- 2015年5月5日
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static String[]复制文件static String[]copyFile(String path, String destPath, List<FileScaleImage> scaleImageList) static String[]copyFileAndSend(File file, String path, List<FileScaleImage> scaleImageList, FileSendResInfo fsri) static String[]cutResImage(String path, String dest, int destWidth, int destHeight, int x, int y, int width, int height) 裁剪资源服务器上的文件static intdeleteAttach(String path) 删除附件static intdeleteFile(String path) static voiddownFile(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream inputStream, String fileName) 下载文件static CommonServer_I获取文件传送对象static String获取资源服务器static FileServer_I获取文件传送对象static FileServer2_I获取文件传送对象static StringgetServeFileUrl(jakarta.servlet.http.HttpServletRequest request, String path) static StringgetServeFileUrl(String path) static StringgetServeFileUrlRestore(jakarta.servlet.http.HttpServletRequest request, String path) 将完整资源服务器路径还原为相对路径static InputStreamgetServerFile(jakarta.servlet.http.HttpServletRequest request, String path) 从服务器上获取文件static InputStreamgetServerFile(String path) 从服务器上获取文件static StringgetToken()获取资源服务器tokenstatic String[]传送文件到资源服务器static String[]sendFile(InputStream is, String path) static String[]sendFile(InputStream is, String path, List<FileScaleImage> scaleImageList, FileSendResInfo fsri) 传送文件到资源服务器static String[]sendFile_copy(String path, String destPath, List<FileScaleImage> scaleImageList) 资源服务器上的文件复制static String[]sendFileTmpAndGetUrl(jakarta.servlet.http.HttpServletRequest request, File file, String resPath) 本地文件上传到资源服务器临时目录,并返回路径
-
字段详细资料
-
fileSeparator
-
-
构造器详细资料
-
ResServerUtil
public ResServerUtil()
-
-
方法详细资料
-
copyFile
复制文件- 参数:
data- 文件数据path- 相对路径- 返回:
- true 成功; false 失败
-
copyFileAndSend
public static String[] copyFileAndSend(File file, String path, List<FileScaleImage> scaleImageList, FileSendResInfo fsri) -
copyFile
-
downFile
public static void downFile(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream inputStream, String fileName) 下载文件- 参数:
request- HttpServletRequestresponse- HttpServletResponseinputStream- InputStreamfileName- 文件名
-
deleteAttach
删除附件- 参数:
path- 路径- 返回:
- 结果
-
getFileSeparator
获取资源服务器- 返回:
- 文件路径符
-
getToken
获取资源服务器token- 返回:
-
sendFile
传送文件到资源服务器- 参数:
buffer- 数据path- 路径- 返回:
- 返回结果
-
cutResImage
public static String[] cutResImage(String path, String dest, int destWidth, int destHeight, int x, int y, int width, int height) 裁剪资源服务器上的文件- 参数:
path- 原图路径dest- 目标图路径destWidth- 原始图缩放宽度destHeight- 原始图缩放高度x- 选择框的左边x坐标y- 选择框的左边y坐标width- 选择框宽度height- 选择框高度- 返回:
- {true|false,""}
-
sendFileTmpAndGetUrl
public static String[] sendFileTmpAndGetUrl(jakarta.servlet.http.HttpServletRequest request, File file, String resPath) 本地文件上传到资源服务器临时目录,并返回路径- 参数:
file-resPath-- 返回:
-
sendFile
-
sendFile
public static String[] sendFile(InputStream is, String path, List<FileScaleImage> scaleImageList, FileSendResInfo fsri) 传送文件到资源服务器- 参数:
is- 输入流path- 路径scaleImageList- 缩放图片对象- 返回:
- 返回结果
-
sendFile_copy
public static String[] sendFile_copy(String path, String destPath, List<FileScaleImage> scaleImageList) 资源服务器上的文件复制- 参数:
path- 路径destPath- 上传路径scaleImageList- 缩放图片对象- 返回:
- 返回结果
-
getServeFileUrl
-
getServeFileUrl
-
getServeFileUrlRestore
public static String getServeFileUrlRestore(jakarta.servlet.http.HttpServletRequest request, String path) 将完整资源服务器路径还原为相对路径- 参数:
request- HttpServletRequest对象path- 路径- 返回:
- 路径
-
getServerFile
从服务器上获取文件- 参数:
path- 相对路径- 返回:
- InputStream
-
getServerFile
public static InputStream getServerFile(jakarta.servlet.http.HttpServletRequest request, String path) 从服务器上获取文件- 参数:
request- HttpServletRequestpath- 相对路径- 返回:
- InputStream
-
deleteFile
-
getFileServer
获取文件传送对象- 返回:
- FileServer_I
- 抛出:
Exception- 异常信息
-
getFileServer2
获取文件传送对象- 返回:
- 抛出:
Exception
-
getCommonServer
获取文件传送对象- 返回:
- CommonServer_I
- 抛出:
Exception- 异常信息
-