public class ResServerUtil
extends java.lang.Object
Description:
Title:首亨软件 - TSS/CRM等
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
fileSeparator |
构造器和说明 |
---|
ResServerUtil() |
限定符和类型 | 方法和说明 |
---|---|
static java.lang.String[] |
copyFile(byte[] data,
java.lang.String path)
复制文件
|
static java.lang.String[] |
copyFile(java.lang.String path,
java.lang.String destPath,
java.util.List<FileScaleImage> scaleImageList) |
static java.lang.String[] |
copyFileAndSend(java.io.File file,
java.lang.String path,
java.util.List<FileScaleImage> scaleImageList,
FileSendResInfo fsri) |
static java.lang.String[] |
cutResImage(java.lang.String path,
java.lang.String dest,
int destWidth,
int destHeight,
int x,
int y,
int width,
int height)
裁剪资源服务器上的文件
|
static int |
deleteAttach(java.lang.String path)
删除附件
|
static int |
deleteFile(java.lang.String path) |
static void |
downFile(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.io.InputStream inputStream,
java.lang.String fileName)
下载文件
|
static com.sh.resource.api.CommonServer_I |
getCommonServer()
获取文件传送对象
|
static java.lang.String |
getFileSeparator()
获取资源服务器
|
static com.sh.resource.api.FileServer_I |
getFileServer()
获取文件传送对象
|
static java.lang.String |
getServeFileUrl(javax.servlet.http.HttpServletRequest request,
java.lang.String path) |
static java.lang.String |
getServeFileUrl(java.lang.String path) |
static java.lang.String |
getServeFileUrlRestore(javax.servlet.http.HttpServletRequest request,
java.lang.String path)
将完整资源服务器路径还原为相对路径
|
static java.io.InputStream |
getServerFile(javax.servlet.http.HttpServletRequest request,
java.lang.String path)
从服务器上获取文件
|
static java.io.InputStream |
getServerFile(java.lang.String path)
从服务器上获取文件
|
static java.lang.String |
getToken()
获取资源服务器token
|
static java.lang.String[] |
sendFile_copy(java.lang.String path,
java.lang.String destPath,
java.util.List<FileScaleImage> scaleImageList)
资源服务器上的文件复制
|
static java.lang.String[] |
sendFile(byte[] buffer,
java.lang.String path)
传送文件到资源服务器
|
static java.lang.String[] |
sendFile(java.io.InputStream is,
java.lang.String path) |
static java.lang.String[] |
sendFile(java.io.InputStream is,
java.lang.String path,
java.util.List<FileScaleImage> scaleImageList,
FileSendResInfo fsri)
传送文件到资源服务器
|
public static java.lang.String[] copyFile(byte[] data, java.lang.String path)
data
- 文件数据path
- 相对路径public static java.lang.String[] copyFileAndSend(java.io.File file, java.lang.String path, java.util.List<FileScaleImage> scaleImageList, FileSendResInfo fsri)
public static java.lang.String[] copyFile(java.lang.String path, java.lang.String destPath, java.util.List<FileScaleImage> scaleImageList)
public static void downFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.InputStream inputStream, java.lang.String fileName)
request
- HttpServletRequestresponse
- HttpServletResponseinputStream
- InputStreamfileName
- 文件名public static int deleteAttach(java.lang.String path)
path
- 路径public static java.lang.String getFileSeparator()
public static java.lang.String getToken()
public static java.lang.String[] sendFile(byte[] buffer, java.lang.String path)
buffer
- 数据path
- 路径public static java.lang.String[] cutResImage(java.lang.String path, java.lang.String dest, int destWidth, int destHeight, int x, int y, int width, int height)
path
- 原图路径dest
- 目标图路径destWidth
- 原始图缩放宽度destHeight
- 原始图缩放高度x
- 选择框的左边x坐标y
- 选择框的左边y坐标width
- 选择框宽度height
- 选择框高度public static java.lang.String[] sendFile(java.io.InputStream is, java.lang.String path)
public static java.lang.String[] sendFile(java.io.InputStream is, java.lang.String path, java.util.List<FileScaleImage> scaleImageList, FileSendResInfo fsri)
is
- 输入流path
- 路径scaleImageList
- 缩放图片对象public static java.lang.String[] sendFile_copy(java.lang.String path, java.lang.String destPath, java.util.List<FileScaleImage> scaleImageList)
path
- 路径destPath
- 上传路径scaleImageList
- 缩放图片对象public static java.lang.String getServeFileUrl(java.lang.String path)
public static java.lang.String getServeFileUrl(javax.servlet.http.HttpServletRequest request, java.lang.String path)
public static java.lang.String getServeFileUrlRestore(javax.servlet.http.HttpServletRequest request, java.lang.String path)
request
- HttpServletRequest对象path
- 路径public static java.io.InputStream getServerFile(java.lang.String path)
path
- 相对路径public static java.io.InputStream getServerFile(javax.servlet.http.HttpServletRequest request, java.lang.String path)
request
- HttpServletRequestpath
- 相对路径public static int deleteFile(java.lang.String path)
public static com.sh.resource.api.FileServer_I getFileServer() throws java.lang.Exception
java.lang.Exception
- 异常信息public static com.sh.resource.api.CommonServer_I getCommonServer() throws java.lang.Exception
java.lang.Exception
- 异常信息