Examples of loadFromXML()


Examples of java.util.Properties.loadFromXML()


    Properties temp = new Properties();
    try {
      if (xml) {
        temp.loadFromXML(stream);
        if (LOG.isDebugEnabled()) {
          LOG.debug(childPath);
          LOG.debug("xml properties: {}", temp.size());
        }
      } else {
View Full Code Here

Examples of java.util.Properties.loadFromXML()

        if (fis == null) {
          throw new IOException("Was unable to open " + configFile);
        }

        // load the configuration file as properties
        customFieldProps.loadFromXML(fis);

        // loop through the properties setting field flags
        Enumeration propKeys = customFieldProps.keys();
        while (propKeys.hasMoreElements()) {
          String prop = (String)propKeys.nextElement();
View Full Code Here

Examples of java.util.Properties.loadFromXML()

      InputStream fis = CustomFields.class.getClassLoader().getResourceAsStream(
        configFile);
      if (fis == null) {
        throw new IOException("Was unable to open " + configFile);
      }
      customFieldProps.loadFromXML(fis);
      Enumeration keys = customFieldProps.keys();
      while (keys.hasMoreElements()) {
        String prop = (String)keys.nextElement();
        if (prop.endsWith(".name")) {
          String propName = prop.substring(0, prop.length() - 5);
View Full Code Here

Examples of java.util.Properties.loadFromXML()

        props = new Properties();
        Util.p("===");
        for(Entry e : props.entrySet()) {
            Util.p("key = " + e.getKey() + " " + e.getValue() );
        }
        props.loadFromXML(new FileInputStream("foo.xml"));
        Util.p("===");
        for(Entry e : props.entrySet()) {
            Util.p("key = " + e.getKey() + " " + e.getValue() );
        }
    }
View Full Code Here

Examples of java.util.Properties.loadFromXML()

    }

    private void loadSettings() {
        try {
            Properties props = new Properties();
            props.loadFromXML(new FileInputStream("settings.xml"));
            Util.p("Loaded settings: " + props.keySet().size());

            recentUniqueSketches.clear();
            if(props.containsKey(RECENT_SKETCHES)) {
                String[] s = props.getProperty(RECENT_SKETCHES).split(",");
View Full Code Here

Examples of java.util.Properties.loadFromXML()

     */
    private long loadVersion(File propertiesfile) {
        long result = CachedRepositoryImpl.UNCOMMITTED_VERSION;
        try {
            Properties props = new Properties();
            props.loadFromXML(new FileInputStream(propertiesfile));
            result = Long.parseLong((String) props.get(VERSION));
        }
        catch (IOException ioe) {
            // We have no data; no problem.
        }
View Full Code Here

Examples of java.util.Properties.loadFromXML()

        // END of transformation hack
       
        final Properties xmlProperties = new Properties() ;
        final ByteArrayInputStream bais = new ByteArrayInputStream(result.toByteArray()) ;
       
        xmlProperties.loadFromXML(bais) ;
       
        final BufferedOutputStream bos = new BufferedOutputStream(propertyOutputStream) ;
        xmlProperties.store(bos, propertyFileComments) ;
        bos.flush() ;
       
View Full Code Here

Examples of java.util.Properties.loadFromXML()

 
  private Properties loadConfigProperties(){
    Properties configProperties = new Properties();
    InputStream configFileInputStream = this.getClass().getResourceAsStream( WekaParam.CONFIGURATION_FILE_RESOURCE);
    try {
      configProperties.loadFromXML(configFileInputStream);
    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (InvalidPropertiesFormatException e) {
      // TODO Auto-generated catch block
View Full Code Here

Examples of java.util.Properties.loadFromXML()

 
  private Properties loadConfigProperties(){
    Properties configProperties = new Properties();
    InputStream configFileInputStream = this.getClass().getResourceAsStream( WekaParam.CONFIGURATION_FILE_RESOURCE );
    try {
      configProperties.loadFromXML(configFileInputStream);
    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (InvalidPropertiesFormatException e) {
      // TODO Auto-generated catch block
View Full Code Here

Examples of java.util.Properties.loadFromXML()

                "]>" + element.toString();
        final Properties properties = new Properties();
        InputStream in = null;
        try {
            in = new ByteArrayInputStream(xml.getBytes());
            properties.loadFromXML(in);
            return properties;
        } catch (IOException e) {
            handleException("IOError loading properties from : " + element, e);
        } finally {
            if (in != null) {
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.