Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Not A Problem
-
1.13
-
None
-
None
-
Important
Description
detect method of org.apache.tika.Tika recognizes byte[] and InputStream as zip.
Tika tika = new Tika();
Path path = Paths.get("C:/abc.xlsx");
byte[] data = Files.readAllBytes(path);
String detectType = tika.detect(data);
System.err.println("Detected type" + detectType);
prints : Detected typeapplication/zip
Tika tika = new Tika();
InputStream targetStream = new FileInputStream(new File("C:/abc.xlsx"));
String detectType = tika.detect(targetStream);
System.err.println("Detected type" + detectType);
prints : Detected typeapplication/zip