static void importMap(InputStream is,Map<String,String> m) throws IOException, InvalidPreferencesFormatException {
  try {
    Document doc=loadPrefsDoc(is);
    Element xmlMap=doc.getDocumentElement();
    String mapVersion=xmlMap.getAttribute("MAP_XML_VERSION");
    if (mapVersion.compareTo(MAP_XML_VERSION) > 0)     throw new InvalidPreferencesFormatException("Preferences map file format version " + mapVersion + " is not supported. This java installation can read"+ " versions "+ MAP_XML_VERSION+ " or older. You may need"+ " to install a newer version of JDK.");
    NodeList entries=xmlMap.getChildNodes();
    for (int i=0, numEntries=entries.getLength(); i < numEntries; i++) {
      Element entry=(Element)entries.item(i);
      m.put(entry.getAttribute("key"),entry.getAttribute("value"));
    }
  }
 catch (  SAXException e) {
    throw new InvalidPreferencesFormatException(e);
  }
}

static void importMap ( InputStream is , Map < String , String > m ) throws IOException , InvalidPreferencesFormatException { try { Document doc = loadPrefsDoc ( is ) ; Element xmlMap = doc . getDocumentElement ( ) ; String mapVersion = xmlMap . getAttribute ( "MAP_XML_VERSION" ) ; if ( mapVersion . compareTo ( MAP_XML_VERSION ) > 0 ) throw new InvalidPreferencesFormatException ( "Preferences map file format version " + mapVersion + " is not supported. This java installation can read" + " versions " + MAP_XML_VERSION + " or older. You may need" + " to install a newer version of JDK." ) ; NodeList entries = xmlMap . getChildNodes ( ) ; for ( int i = 0 , numEntries = entries . getLength ( ) ; i < numEntries ; i ++ ) { Element entry = ( Element ) entries . item ( i ) ; m . put ( entry . getAttribute ( "key" ) , entry . getAttribute ( "value" ) ) ; } } catch ( SAXException e ) { throw new InvalidPreferencesFormatException ( e ) ; } }
import map from the specified input stream , which is assumed to contain a map document as per the prefs dtd . this is used as the internal ( undocumented ) format for filesystemprefs . the key - value pairs specified in the xml document will be put into the specified map . ( if this map is empty , it will contain exactly the key - value pairs int the xml - document when this method returns . )
