Posted By

ananthu2050 on 12/02/09


Tagged

file property Bundle Resource


Versions (?)

Load property files and get values


 / Published in: Java
 

  1. import java.util.Enumeration;
  2. import java.util.Properties;
  3. import java.util.ResourceBundle;
  4.  
  5.  
  6. public class TestResource {
  7.  
  8. public static void main(String[] args) {
  9. TestResource tstresource = new TestResource();
  10. .getBundle("com.honeywell.resources.test");
  11. //test.properties was my property file
  12. Properties result = new Properties();
  13. for (Enumeration keys = rb.getKeys(); keys.hasMoreElements();) {
  14. final String key = (String) keys.nextElement();
  15. final String value = rb.getString(key);
  16.  
  17. result.put(key, value);
  18. }
  19. System.out.println(result.getProperty("ippeee"));
  20.  
  21. }
  22. }

Report this snippet  

You need to login to post a comment.