/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }
/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
/*************************************************************************** * utilities for Preferences export **************************************************************************/ static void exportPrefs(Preferences prefs, OutputStream stream, boolean withSubTree) throws IOException, BackingStoreException { indent = -1; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); out.write(HEADER); out.newLine(); out.newLine(); out.write(DOCTYPE); out.write(" '"); out.write(PREFS_DTD_NAME); out.write("'>"); out.newLine(); out.newLine(); flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" }, new String[] { String.valueOf(XML_VERSION) }, out); flushStartTag("root", new String[] { "type" }, new String[] { prefs.isUserNode() ? "user" : "system" }, out); flushEmptyElement("map", out); StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/"); exportNode(ancestors, prefs, withSubTree, out); flushEndTag("root", out); flushEndTag("preferences", out); out.flush(); out = null; }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }
private static void exportNode(StringTokenizer ancestors, Preferences prefs, boolean withSubTree, BufferedWriter out) throws IOException, BackingStoreException { if (ancestors.hasMoreTokens()) { String name = ancestors.nextToken(); flushStartTag("node", new String[] { "name" }, new String[] { name }, out); if (ancestors.hasMoreTokens()) { flushEmptyElement("map", out); exportNode(ancestors, prefs, withSubTree, out); } else { exportEntries(prefs, out); if (withSubTree) { exportSubTree(prefs, out); } } flushEndTag("node", out); } }