Class FSSHelper

java.lang.Object
cool.scx.app.x.fss.FSSHelper

public final class FSSHelper extends Object
FSSHelper
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • FSSHelper

      public FSSHelper()
  • Method Details

    • getPositions

      public static net.coobird.thumbnailator.geometry.Positions getPositions(String type)
    • getPhysicalFilePath

      public static Path getPhysicalFilePath(FSSObject fssObject)
      获取物理文件路径
      Parameters:
      fssObject - a FSSObject object
      Returns:
      a Path object
    • checkPhysicalFile

      public static Path checkPhysicalFile(FSSObject fssObject) throws cool.scx.http.exception.NotFoundException
      检查物理文件是否存在 存在则返回物理文件 不存在则抛出异常
      Parameters:
      fssObject - a FSSObject object
      Returns:
      a File object
      Throws:
      cool.scx.http.exception.NotFoundException - if any.
    • getUploadTempPath

      public static Path getUploadTempPath(String fileHash)
    • copyFSSObject

      public static FSSObject copyFSSObject(String fileName, FSSObject oldFSSObject)
    • createFSSObjectByFileInfo

      public static FSSObject createFSSObjectByFileInfo(String fileName, Long fileSize, String fileHash)
      根据文件信息 创建 FSSObject 实例 规则如下 fssObjectID (文件 id) : 随机字符串 filePath (文件物理文件存储路径) : 年份(以上传时间为标准)/月份(以上传时间为标准)/天(以上传时间为标准)/文件MD5/文件真实名称 其他字段和字面意义相同
      Parameters:
      fileName - a String object.
      fileSize - a Long object.
      fileHash - a String object.
      Returns:
      a FSSObject object.
    • getLastUploadChunk

      public static Integer getLastUploadChunk(Path uploadConfigFile, Integer chunkLength) throws IOException
      Throws:
      IOException
    • updateLastUploadChunk

      public static void updateLastUploadChunk(Path uploadConfigFile, Integer nowChunkIndex, Integer chunkLength) throws IOException
      更新最后一次文件上传的区块
      Parameters:
      uploadConfigFile - a File object.
      nowChunkIndex - a Integer object.
      chunkLength - a Integer object.
      Throws:
      IOException - e