类 FilePartAssist

java.lang.Object
dev.utils.common.file.FilePartAssist

public final class FilePartAssist extends Object
detail: 文件分片辅助类
作者:
Ttt
  • 构造器详细资料

    • FilePartAssist

      public FilePartAssist(File file, List<FilePartItem> filePartItems)
      构造函数
      参数:
      file - 文件
      filePartItems - 文件分片信息集合
    • FilePartAssist

      public FilePartAssist(String filePath, int partCount)
      构造函数
      参数:
      filePath - 文件路径
      partCount - 分片总数
    • FilePartAssist

      public FilePartAssist(File file, int partCount)
      构造函数
      参数:
      file - 文件
      partCount - 分片总数
  • 方法详细资料

    • getFile

      public File getFile()
      获取文件
      返回:
      File
    • getFileName

      public String getFileName()
      获取文件名
      返回:
      文件名
    • getFilePartItems

      public List<FilePartItem> getFilePartItems()
      获取文件分片信息集合
      返回:
      List<FilePartItem>
    • getFilePartItem

      public FilePartItem getFilePartItem(int partIndex)
      获取指定索引文件分片信息
      参数:
      partIndex - 分片索引
      返回:
      FilePartItem
    • getPartCount

      public int getPartCount()
      获取分片总数
      返回:
      分片总数
    • existsPart

      public boolean existsPart()
      是否存在分片
      返回:
      true yes, false no
    • isOnlyOne

      public boolean isOnlyOne()
      是否只有一个分片
      返回:
      true yes, false no
    • getPartName

      public String getPartName(int partIndex)
      获取分片文件名 ( 后缀索引拼接 )
      参数:
      partIndex - 分片索引
      返回:
      分片文件名