< prev index next >
src/java.base/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 24,33 ****
--- 24,34 ----
*/
package jdk.internal.util.xml;
import java.io.*;
+ import java.nio.charset.Charset;
import java.util.InvalidPropertiesFormatException;
import java.util.Map.Entry;
import java.util.Properties;
import jdk.internal.org.xml.sax.Attributes;
import jdk.internal.org.xml.sax.InputSource;
*** 92,106 ****
* can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
* " may need to install a newer version of JDK.");
*/
}
! public void store(Properties props, OutputStream os, String comment, String encoding)
throws IOException
{
try {
! XMLStreamWriter writer = new XMLStreamWriterImpl(os, encoding);
writer.writeStartDocument();
writer.writeDTD(PROPS_DTD_DECL);
writer.writeStartElement(ELEMENT_ROOT);
if (comment != null && comment.length() > 0) {
writer.writeStartElement(ELEMENT_COMMENT);
--- 93,107 ----
* can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
* " may need to install a newer version of JDK.");
*/
}
! public void store(Properties props, OutputStream os, String comment, Charset charset)
throws IOException
{
try {
! XMLStreamWriter writer = new XMLStreamWriterImpl(os, charset);
writer.writeStartDocument();
writer.writeDTD(PROPS_DTD_DECL);
writer.writeStartElement(ELEMENT_ROOT);
if (comment != null && comment.length() > 0) {
writer.writeStartElement(ELEMENT_COMMENT);
< prev index next >