Reputation: 21
I am using tika-core.jar
to detect the mime type.
When I try to find the mime type of bat file, it is giving mime type as text/plain
instead of application/x-bat
.
Upvotes: 1
Views: 786
Reputation: 611
Note: in the case of *.bat files, Tika (1.24.1) relies only on the .bat extension only, it does not parse the content. And just noticed that's not even alway true. It does not spot *.ps1 even with the extension. In both cases it returns text/plain
Upvotes: 0
Reputation: 16459
Tika is giving the correct output.
The jar used is tika-core-1.22
.
The code is given below (what I have tried) :
public class Test {
public static void main(String[] args) throws IOException {
File batchFile = new File("C:/Users/Anish/Desktop/abc.bat");
Tika tika = new Tika();
System.out.println(tika.detect(batchFile));
}
}
Screenshot of the output :
Upvotes: 3
Reputation: 21
still am getting text/plain for bat file. I don't understand why i am getting text/plain
Upvotes: 0