apache-tika
How to add a custom MIME type and override a default extension pattern?
Seems you need to add a magic tag with a priority <mime-type type=”text/stringtemplate”> <magic priority=”50″> <!– some match pattern –> <!– <match value=”[some characters]” type=”string” offset=”0″ /> –> </magic> <glob pattern=”*.st”/> </mime-type>
Read Content from Files which are inside Zip file
If you’re wondering how to get the file content from each ZipEntry it’s actually quite simple. Here’s a sample code: public static void main(String[] args) throws IOException { ZipFile zipFile = new ZipFile(“C:/test.zip”); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while(entries.hasMoreElements()){ ZipEntry entry = entries.nextElement(); InputStream stream = zipFile.getInputStream(entry); } } Once you have the InputStream … Read more