code_junkie

loading properties file from java package

Nov 12th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Properties prop = new Properties();
  2. InputStream in = getClass().getResourceAsStream("foo.properties");
  3. prop.load(in);
  4. in.close()
  5.  
  6. InputStream in = getClass().getResourceAsStream("/com/al/common/email/templates/foo.properties");
  7.  
  8. static {
  9. Properties prop = new Properties();
  10. InputStream in = CurrentClassName.class.getClass().getResourceAsStream("foo.properties");
  11. prop.load(in);
  12. in.close()
  13. }
Add Comment
Please, Sign In to add comment