Package java.util

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


        // 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

 
  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

 
  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

                "]>" + 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

                "]>" + 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);
        } finally {
            if (in != null) {
View Full Code Here

    for(String f : files) {
      File file = FileHelper.getFile(f);
      InputStream input = new FileInputStream(file);
      try {
        if(file.getPath().endsWith(".xml")){
          properties.loadFromXML(input);
        }else {
          properties.load(input);
        }
        properties.putAll(properties);
      }finally {
View Full Code Here

  public Properties loadProperties(String file) {
    try {
      Properties p = new Properties();
      InputStream in = FileHelper.getInputStream(file);
      if(file.endsWith(".xml")) {
        p.loadFromXML(in);
      }else {
        p.load(in);
      }
      in.close();
      return p;
View Full Code Here

    protected void loadFile(File file) throws BuildException {
        if(file.getName().endsWith(".xml")) {
            try {
                Properties props = new Properties();
                FileInputStream in = new FileInputStream(file);
                props.loadFromXML(in);
                in.close();
                addProperties(props);
            }catch(IOException e) {
                throw new BuildException("load properties occer error:"+file+" cause:"+e,e);
            }
View Full Code Here

                if (log.isDebugEnabled()) {
                    log.debug("Loading properties from path [" + resourcePath + "] in XML format...");
                }

                props.loadFromXML(is);
            } else {

                if (log.isDebugEnabled()) {
                    log.debug("Loading properties from path [" + resourcePath + "]...");
                }
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.