code: public static FirefoxProfile getFirefoxProfile(Map<String, Object> profile) {
          FirefoxProfile fxProfile = new FirefoxProfile();
          if (profile != null) {
              for (Map.Entry<String, Object> profileEntry : profile.entrySet()) {
                  String key = profileEntry.getKey();
                  Object value = profileEntry.getValue();
                  if (value instanceof Boolean) {
                      fxProfile.setPreference(key, (Boolean) value);
                  } else if (value instanceof Integer) {
                      fxProfile.setPreference(key, (Integer) value);
                  } else if (value == null) {
                      fxProfile.setPreference(key, null);
                  } else {
                      fxProfile.setPreference(key, value.toString());
                  }
              }
          }
          return fxProfile;
      }
docs: Set firefox profile. For example to make sure text/csv file is downloaded without asking (convenient if run on buildserver), do:
  |script           |selenium driver setup                                                                                               |
  |start driver for |firefox              |with profile|!{browser.download.folderList:2,browser.helperApps.neverAsk.saveToDisk:text/csv}||
  @param profile setting from subtable
  @return firefox profile with specified settings