java.lang.Object
cn.toutatis.xvoid.axolotl.excel.support.tika.TikaShell

public class TikaShell extends Object
Tika 工具壳
作者:
Toutatis_Gc
  • 字段详细资料

    • MS_EXCEL

      public static final org.apache.tika.mime.MimeType MS_EXCEL
      MS_EXCEL Excel 97-2003文件版本 application/vnd.ms-excel 后缀为[.xls]
    • OOXML_EXCEL

      public static final org.apache.tika.mime.MimeType OOXML_EXCEL
      OOXML_EXCEL Excel 2007及以上版本 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 后缀为[.xlsx]
  • 构造器详细资料

    • TikaShell

      public TikaShell()
  • 方法详细资料

    • detect

      public static DetectResult detect(File file, org.apache.tika.mime.MimeType mimeType)
    • detect

      public static DetectResult detect(File file, org.apache.tika.mime.MimeType mimeType, boolean alreadyPreCheck)
    • detectThrowException

      public static DetectResult detectThrowException(File file, org.apache.tika.mime.MimeType mimeType)
    • detect

      public static DetectResult detect(File file, org.apache.tika.mime.MimeType mimeType, boolean throwException, boolean alreadyPreCheck)
      判断文件是否正常并且为需要的格式 1.文件预检查 2.文件后缀是否匹配 3.文件媒体类型是否匹配
      参数:
      file - 文件
      mimeType - 想要匹配的MIME类型
      throwException - 是否抛出异常
      alreadyPreCheck - 文件是否已通过预检查
      返回:
      检测结果
    • getMimeType

      public static org.apache.tika.mime.MimeType getMimeType(File file)
      获取文件类型
      参数:
      file - 文件
      返回:
      MIME类型
    • preCheckFileNormalThrowException

      public static DetectResult preCheckFileNormalThrowException(File file)
      预检查文件是否正常并抛出异常
      参数:
      file - 文件
      返回:
      检测结果
    • preCheckFileNormal

      public static DetectResult preCheckFileNormal(File file)
      预检查文件是否正常
      参数:
      file - 文件
      返回:
      检测结果
    • preCheckFileNormal

      public static DetectResult preCheckFileNormal(File file, boolean throwException)
      预检查文件是否正常
      参数:
      file - 文件
      throwException - 是否抛出异常
      返回:
      检测结果