dcsimg

How do I set up a default mime type for unknown file types using MimetypesFileTypeMap? At present when sending a message with an attached file of unknown file type a NullPointerException is thrown.

Rajesh Ajmera

Just create a new map and ask:


MimetypesFileTypeMap mmp = new MimetypesFileTypeMap();
System.out.println(mmp.getContentType("d:
ajeshlbc.jpg"));