Code example for Properties

Methods: loadFromXML

0
     
    @Override 
    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);
            } 
        }else { 
            super.loadFile(file);
        } 
    } 
}