Access value in one .properties file from another .properties file

Viewed 162

Consider 2 property files:

  1. abc.properties
  2. bcd.properties

I need to get Strings from abc.properties in bcd.properties. Using CompositeConfiguration I got solution but its not a generic solution in my project.Please suggest a way to do it using ResourceBundle itself.

Sharing what I have done :

ResourceBundle  inStream = ResourceBundle.getBundle("bcd", Locale.US); 
  Properties test = new Properties();
  String keys = inStream.getString("Email");
  System.out.println("Result here "+keys);
        
abc.properties : 
  Email=Not a valid email address

bcd.properties : 
  include = abc.properties
  //some strings

Hope you got my issue. Thanks in advance!

0 Answers
Related