Created
September 16, 2013 14:37
-
-
Save kabronkline/6581541 to your computer and use it in GitHub Desktop.
Apache Tika (version 0.8) Mime Type Detection in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String mimeType = "application/octet-stream"; | |
| Tika tika = new Tika(); | |
| try { | |
| mimeType = tika.detect(file); | |
| } catch (Exception ex) { | |
| log.error(ex); | |
| } | |
| return mimeType; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment