Javability (Java, Zaurus, Linux, Live) by Jean-Marc Autexier, Saarland/Germany
cat /dev/www | egrep 'Java|Linux|Zaurus|ITnews|Live' > blog

24.7.04 18:31 JMimeMagic ( , , , )

Java: JMimeMagic is a Java library that retrieves file and stream mime types by checking magic headers. Usage is very simple.

Code sample:
MagicParser parser = new MagicParser() ;
// getMagicMatch accepts Files or byte[], which is nice if you want to test streams
MagicMatch match = parser.getMagicMatch(new File("test_docs/test.gif")) ;
System.out.println(match.getMimeType()) ;

The list of supported mime types is already quite long.
License is LGPL.

posted by Jean-Marc Autexier | 0 comments | Permalink | Send to Friends | Google it!
Subscribe

Locations of visitors to this page
selected blogs
ressources
Security
Unsorted
Fun
Free&Open Software
archives
This is a personal web page. Things said here do not represent the position of my employer.
RSS icons by: FastIcon.com