To get the mime type, we have defined FileNameMap interface, that is a simple interface and available into the java.net package.
Java Get Mime Type
To get the mime type, we have defined FileNameMap interface, that is a simple interface and available into the java.net package. FileNameMap interface includes all the mechanism to map between a file name and mime type string in Java.
Go through the given example to find out, how to get mime type.
Syntax for getting mime type in Java
import java.net.*;
|
Output will be displayed as: