类的使用
cn.toutatis.xvoid.axolotl.toolkit.tika.DetectResult
使用DetectResult的程序包
-
cn.toutatis.xvoid.axolotl.excel中DetectResult的使用
参数类型为DetectResult的cn.toutatis.xvoid.axolotl.excel中的构造器限定符构造器说明WorkBookContext(File file, DetectResult detectResult) WorkBookContext(InputStream ins, DetectResult detectResult) -
cn.toutatis.xvoid.axolotl.toolkit.tika中DetectResult的使用
修饰符和类型方法说明static DetectResultstatic DetectResultstatic DetectResultTikaShell.detect(File file, org.apache.tika.mime.MimeType wantedMimeType, boolean throwException, boolean alreadyPreCheck) 判断文件是否正常并且为需要的格式 1.文件预检查 2.文件后缀是否匹配 3.文件媒体类型是否匹配static DetectResultTikaShell.detect(InputStream ins, org.apache.tika.mime.MimeType wantedMimeType, boolean throwException) 判断文件是否正常并且为需要的格式 流的情况较为特殊,由于流获取内容仅为字节,在获取文件类型时仅能获取较为特殊的几种类型,因此需要进行额外的判断 Excel文件本身为ZIP压缩类型,其中有特殊的标志文件可以进行判断,其余特殊类型请自行实现判断或提交PR进行类型补充static DetectResultTikaShell.detectThrowException(File file, org.apache.tika.mime.MimeType mimeType) static DetectResultTikaShell.preCheckFileNormal(File file) 预检查文件是否正常static DetectResultTikaShell.preCheckFileNormal(File file, boolean throwException) 预检查文件是否正常static DetectResultTikaShell.preCheckFileNormalThrowException(File file) 预检查文件是否正常并抛出异常DetectResult.returnInfo(String msg) 返回文件状态信息