类 ResServerUtil

java.lang.Object
com.sh.wf.module.component.common.ResServerUtil

public class ResServerUtil extends Object

Description:

Title:首亨软件 - TSS/CRM等

从以下版本开始:
2015年5月5日
  • 字段详细资料

    • fileSeparator

      public static String fileSeparator
  • 构造器详细资料

    • ResServerUtil

      public ResServerUtil()
  • 方法详细资料

    • copyFile

      public static String[] copyFile(byte[] data, String path)
      复制文件
      参数:
      data - 文件数据
      path - 相对路径
      返回:
      true 成功; false 失败
    • copyFileAndSend

      public static String[] copyFileAndSend(File file, String path, List<FileScaleImage> scaleImageList, FileSendResInfo fsri)
    • copyFile

      public static String[] copyFile(String path, String destPath, List<FileScaleImage> scaleImageList)
    • downFile

      public static void downFile(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream inputStream, String fileName)
      下载文件
      参数:
      request - HttpServletRequest
      response - HttpServletResponse
      inputStream - InputStream
      fileName - 文件名
    • deleteAttach

      public static int deleteAttach(String path)
      删除附件
      参数:
      path - 路径
      返回:
      结果
    • getFileSeparator

      public static String getFileSeparator()
      获取资源服务器
      返回:
      文件路径符
    • getToken

      public static String getToken()
      获取资源服务器token
      返回:
    • sendFile

      public static String[] sendFile(byte[] buffer, String path)
      传送文件到资源服务器
      参数:
      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

      public static String[] sendFile(InputStream is, String path)
    • 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

      public static String getServeFileUrl(String path)
    • getServeFileUrl

      public static String getServeFileUrl(jakarta.servlet.http.HttpServletRequest request, String path)
    • getServeFileUrlRestore

      public static String getServeFileUrlRestore(jakarta.servlet.http.HttpServletRequest request, String path)
      将完整资源服务器路径还原为相对路径
      参数:
      request - HttpServletRequest对象
      path - 路径
      返回:
      路径
    • getServerFile

      public static InputStream getServerFile(String path)
      从服务器上获取文件
      参数:
      path - 相对路径
      返回:
      InputStream
    • getServerFile

      public static InputStream getServerFile(jakarta.servlet.http.HttpServletRequest request, String path)
      从服务器上获取文件
      参数:
      request - HttpServletRequest
      path - 相对路径
      返回:
      InputStream
    • deleteFile

      public static int deleteFile(String path)
    • getFileServer

      public static FileServer_I getFileServer() throws Exception
      获取文件传送对象
      返回:
      FileServer_I
      抛出:
      Exception - 异常信息
    • getFileServer2

      public static FileServer2_I getFileServer2() throws Exception
      获取文件传送对象
      返回:
      抛出:
      Exception
    • getCommonServer

      public static CommonServer_I getCommonServer() throws Exception
      获取文件传送对象
      返回:
      CommonServer_I
      抛出:
      Exception - 异常信息