Package java.util

Examples of java.util.Properties.storeToXML()


        msgProperties.setProperty("email", email);
      }
    }
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
      msgProperties.storeToXML(baos, "OLAT Registration Data, since 6.1.1 Release");
    } catch (IOException e) {
      throw new OLATRuntimeException("OLAT Registration failed",e);
    }
    String retVal = null;
    try {
View Full Code Here


    private void saveVersion(File properties, Long version) {
        Properties props = new Properties();
        props.put(VERSION, version.toString());
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(properties);
            props.storeToXML(fileOutputStream, null);
        }
        catch (IOException e) {
            m_log.log(LogService.LOG_ERROR, "UpdateUserAdminTask failed to save local version number.");
        }
    }
View Full Code Here

                "&amp;&value13<b>&amp;</b>");

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        // store in UTF-8 encoding
        myProps.storeToXML(out, "comment");
        out.close();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Properties myProps2 = new Properties();
        myProps2.loadFromXML(in);
View Full Code Here

         }
      };
      sorted.putAll(properties);
      OutputStream stream = new FileOutputStream(outputFile);
      try {
         sorted.storeToXML(stream, null);
      } finally {
         stream.close();
      }
   }
View Full Code Here

                "&amp;&value13<b>&amp;</b>");

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        // store in UTF-8 encoding
        myProps.storeToXML(out, "comment");
        out.close();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Properties myProps2 = new Properties();
        myProps2.loadFromXML(in);
View Full Code Here

        props.setProperty("asdf", "asdfasdf");
        Util.p("===");
        for(Entry e : props.entrySet()) {
            Util.p("key = " + e.getKey() + " " + e.getValue() );
        }
        props.storeToXML(new FileOutputStream("foo.xml"), "foo");
        props.clear();
        props = new Properties();
        Util.p("===");
        for(Entry e : props.entrySet()) {
            Util.p("key = " + e.getKey() + " " + e.getValue() );
View Full Code Here

            props.setProperty(RECENT_SKETCHES, sb.toString());
            props.setProperty(COMPILER_COMMANDS_SHOWN, Boolean.toString(isCompilerCommandsShown()));
           
           
            props.store(new FileOutputStream("settings.props"), "foo");           
            props.storeToXML(new FileOutputStream("settings.xml"), "ArduinoX Settings", "UTF-8");
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
View Full Code Here

    private void saveVersion(File properties, Long version) {
        Properties props = new Properties();
        props.put(VERSION, version.toString());
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(properties);
            props.storeToXML(fileOutputStream, null);
        }
        catch (IOException e) {
            m_log.log(LogService.LOG_ERROR, "UpdateUserAdminTask failed to save local version number.");
        }
    }
View Full Code Here

        myProps.setProperty("<a>&amp;key13&lt;</a>",
                "&amp;&value13<b>&amp;</b>");

        // store in UTF-8 encoding
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        myProps.storeToXML(out, "comment");
        out.close();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Properties myProps2 = new Properties();
        myProps2.loadFromXML(in);
View Full Code Here

    props.setProperty("outdir", tempDir.getAbsolutePath());
    File propFile = new File(tempDir, "export.xml");
    OutputStream fos = null;
    try {
      fos = new FileOutputStream(propFile);
      props.storeToXML(fos, null);
    } finally {
      fos.close();
    }
    return propFile;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.