I am looking among the standard libraries (like apache commons, jax, jboss, javax) for an interface or enum that lists the values of all the standard mime-type (aka content-
If you're on android you have multiple choices, where only the first is a kind of "enum":
HTTP.PLAIN_TEXT_TYPE orfinal String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);For example
@Override
public String getType(Uri uri) {
return URLConnection.getFileNameMap().getContentTypeFor(
uri.getLastPathSegment());
}