I Wants to replace sun.net.www.MimeTable and sun.net.www.MimeEntry from code since getting warning "MimeTable is internal proprietary API and may be removed in a future release". Please help me with which new API replaced it and which one I should use. Below is my code for which mimeDescription is input as a string.
sun.net.www.MimeTable mimeTable = sun.net.www.MimeTable.getDefaultTable();
sun.net.www.MimeEntry mimeEntry = mimeTable.find(mimeDescription);
if (mimeEntry == null) {
// try findByDescription()
mimeEntry = mimeTable.findByDescription(mimeDescription);
if (mimeEntry == null) {
LOG.info ( "Couldn't find mimeDescription=" + mimeDescription);
return null;
}
}
return mimeEntry.getExtensions();