Package java.util

Examples of java.util.Properties.loadFromXML()


        // 3. Create indexes
        LOG.debug("Creating indexes");
        try {
            InputStream indexesStream = getClass().getResourceAsStream("/indexes.xml");
            Properties indexes = new Properties();
            indexes.loadFromXML(indexesStream);

            for (String idx : indexes.stringPropertyNames()) {
                LOG.debug("Creating index {}", indexes.get(idx).toString());

                try {
View Full Code Here



    Properties testProps = new Properties();
    try
    {
      testProps.loadFromXML(tis);
    }
    catch (Exception e)
    {
      errLog("Unable to parse test description file, " + sTestFile +
             " Exception thrown: " + e.getMessage());
View Full Code Here

      System.exit(1);
    }
    Properties exProps = new Properties();
    try
    {
      exProps.loadFromXML(exIs);
    }
    catch (Exception e)
    {
      errLog("Unable to parse test exclusions file, " +
             sTestExclusionsFile + " Exception thrown: " + e.getMessage());
View Full Code Here

    boolean propsLoaded = false;
    if (fileName != null && fileName.length() > 0) {
      try {
        is = new BufferedInputStream(new FileInputStream(fileName));
        if (fileName.endsWith(".xml"))
          kernelProps.loadFromXML(is);
        else
          kernelProps.load(is);
        propsLoaded = true;
      } catch (FileNotFoundException fe) {
        // do nothing - options not required
View Full Code Here

      final Map<Long, Integer> instanceIdToIndexMap = new HashMap<Long, Integer>();
      // map of instance id -> class label
      final Map<Long, String> instanceIDClassLabel = new TreeMap<Long, String>();
      in = new FileInputStream(propertyFile);
      if (propertyFile.endsWith(".xml"))
        props.loadFromXML(in);
      else
        props.load(in);
      matrixWriter = new BufferedWriter(new FileWriter(props
          .getProperty("matrixFile")));
      String kernelEvaluationNames = props
View Full Code Here

     * @tests java.util.Properties#loadFromXML(java.io.InputStream)
     */
    public void test_loadFromXMLLjava_io_InputStream() throws IOException {
        Properties prop = new Properties();
        InputStream is = new ByteArrayInputStream(writePropertiesXML("UTF-8"));
        prop.loadFromXML(is);
        is.close();

        assertEquals("Failed to load correct properties", "value3", prop
                .getProperty("key3"));
        assertEquals("Failed to load correct properties", "value1", prop
View Full Code Here

        assertEquals("Failed to load correct properties", "value1", prop
                .getProperty("key1"));

        prop = new Properties();
        is = new ByteArrayInputStream(writePropertiesXML("ISO-8859-1"));
        prop.loadFromXML(is);
        is.close();

        assertEquals("Failed to load correct properties", "value2", prop
                .getProperty("key2"));
        assertEquals("Failed to load correct properties", "value1", prop
View Full Code Here

        myProps.storeToXML(out, "comment");
        out.close();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Properties myProps2 = new Properties();
        myProps2.loadFromXML(in);
        in.close();

        Enumeration e = myProps.propertyNames();
        while (e.hasMoreElements()) {
            String nextKey = (String) e.nextElement();
View Full Code Here

        myProps.storeToXML(out, "comment", "ISO-8859-1");
        out.close();

        in = new ByteArrayInputStream(out.toByteArray());
        myProps2 = new Properties();
        myProps2.loadFromXML(in);
        in.close();

        e = myProps.propertyNames();
        while (e.hasMoreElements()) {
            String nextKey = (String) e.nextElement();
View Full Code Here

    private StorageConfigurator() {
        InputStream stream = StorageConfigurator.class
                .getResourceAsStream("/lucenestorage.properties.xml");
        Properties properties = new Properties();
        try {
            properties.loadFromXML(stream);
        } catch (Exception e) {
            throw new StorageConfigurationError("Could not load properties", e);
        }
        this.storageBufferSize = Integer.parseInt(properties
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.