Created
January 7, 2014 12:59
-
-
Save michalbcz/8298941 to your computer and use it in GitHub Desktop.
Java Standard Library way to find out MIME type according to file name (extension)
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
import java.net.URLConnection; | |
assert URLConnection.getFileNameMap().getContentTypeFor("someimage.png") == 'image/png' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment