Return to Snippet

Revision: 21022
at December 2, 2009 04:24 by ananthu2050


Initial Code
import java.util.Enumeration;
import java.util.Properties;
import java.util.ResourceBundle;


public class TestResource {

    public static void main(String[] args) {
	TestResource tstresource = new TestResource();
	ResourceBundle rb = ResourceBundle
		.getBundle("com.honeywell.resources.test");
//test.properties was my property file
	Properties result = new Properties();
	for (Enumeration keys = rb.getKeys(); keys.hasMoreElements();) {
	    final String key = (String) keys.nextElement();
	    final String value = rb.getString(key);

	    result.put(key, value);
	}
	System.out.println(result.getProperty("ippeee"));

    }
}

Initial URL

                                

Initial Description

                                

Initial Title
Load property files and get values

Initial Tags
file

Initial Language
Java