|
Several places could benefit from configuring MediaType objects. Rather than reinventing parsing and matching via regular expressions or other mechanism, we could just use com.google.common.net.MediaType, which is a very convenient class to manipulate mime types.
eg: MediaType.parse("image/png").is(MediaType.parse("image/*")) // returns true
From the below, one can easily figure out why it'd be beneficial to configure stuff (e.g someFileMediaType.is(configuredMT) to query whether this file can be treated by a configured component), and how to implement a Node2Bean converter.
http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/index.html?com/google/common/net/MediaType.html
|