This post originated from an RSS feed registered with Java Buzz
by Simon Brown.
Original Post: Getting MIME types with java.net.FileNameMap
Feed Title: Simon Brown's weblog
Feed URL: http://www.simongbrown.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on Java, software development and technology.
FileNameMap from the java.net package is a simple interface which provides a mechanism to map between a file name and a MIME type string. It's not actually something that I've come across before, even though it's existed since version 1.1 of the JDK. However, with code like the following, you can get the MIME type using the default JDK mappings that are specified in the JAVA_HOME/lib/content-types.properties file.