src/share/classes/sun/util/xml/DefaultPropertiesXMLUtils.java
branchxml-sax-and-dom-2
changeset 1262 52864f10883d
parent 1261 29f4f9b451b8
     1.1 --- a/src/share/classes/sun/util/xml/DefaultPropertiesXMLUtils.java	Wed Jun 24 14:53:01 2009 +0200
     1.2 +++ b/src/share/classes/sun/util/xml/DefaultPropertiesXMLUtils.java	Wed Jun 24 16:38:24 2009 +0200
     1.3 @@ -40,7 +40,14 @@
     1.4  public class DefaultPropertiesXMLUtils extends PropertiesXMLUtils {
     1.5      public void load(Properties props, InputStream in)
     1.6      throws IOException, InvalidPropertiesFormatException {
     1.7 -        throw new IOException("Not implemented yet");
     1.8 +        XMLElement e = new XMLElement();
     1.9 +        e.parseFromReader(new InputStreamReader(in, "UTF-8"));
    1.10 +        for (Object o : e.getChildren()) {
    1.11 +            XMLElement ch = (XMLElement)o;
    1.12 +            if (ch.getName().equals("entry")) {
    1.13 +                props.put(ch.getAttribute("key"), ch.getContent());
    1.14 +            }
    1.15 +        }
    1.16      }
    1.17      public void save(Properties props, OutputStream out, String comment, String encoding)
    1.18      throws IOException {