public static void loadMimeMappings(){
  final String[] CONTENT_TYPES=new String[]{"application/atom+xml","application/rss+xml","application/json"};
  final String CONTENT_HANDLER=";; x-java-content-handler" + "=com.google.gdata.data.media.GDataContentHandler";
  CommandMap commandMap=CommandMap.getDefaultCommandMap();
  if (commandMap instanceof MailcapCommandMap) {
    MailcapCommandMap mailcapMap=(MailcapCommandMap)commandMap;
    for (int i=0; i < CONTENT_TYPES.length; i++) {
      CommandInfo[] comm=mailcapMap.getAllCommands(CONTENT_TYPES[i]);
      if (comm == null || comm.length == 0) {
        mailcapMap.addMailcap(CONTENT_TYPES[i] + CONTENT_HANDLER);
      }
    }
  }
 else {
    LOGGER.warning("Unable to find MailcapCommandMap, skipping dynamic mailcap config.");
  }
}

public static void loadMimeMappings ( ) { final String [ ] CONTENT_TYPES = new String [ ] { "application/atom+xml" , "application/rss+xml" , "application/json" } ; final String CONTENT_HANDLER = ";; x-java-content-handler" + "=com.google.gdata.data.media.GDataContentHandler" ; CommandMap commandMap = CommandMap . getDefaultCommandMap ( ) ; if ( commandMap instanceof MailcapCommandMap ) { MailcapCommandMap mailcapMap = ( MailcapCommandMap ) commandMap ; for ( int i = 0 ; i < CONTENT_TYPES . length ; i ++ ) { CommandInfo [ ] comm = mailcapMap . getAllCommands ( CONTENT_TYPES [ i ] ) ; if ( comm == null || comm . length == 0 ) { mailcapMap . addMailcap ( CONTENT_TYPES [ i ] + CONTENT_HANDLER ) ; } } } else { LOGGER . warning ( "Unable to find MailcapCommandMap, skipping dynamic mailcap config." ) ; } }
loads the default set of java activation mime mappings required by the gdata library . extends the basic set configured by the javamail library to add mappings for atom , rss , and json application types .
