spring - Loading Java Properties Files by Profile -


i want load properties files in java code. use profile config -dspring.profiles.active=local or dev... how load properties files profile this:

classpath:${spring.profiles.active}/test.properties 

how in java code ? did below, null.

properties prop = new properties(); inputstream istream = helper.class.getclassloader().getresourceasstream("test.properties");     try {         prop.load(istream);     } catch (ioexception e) {         log.error(e.getmessage(), e);     } {         try {             istream.close();         } catch (ioexception e) {             log.error(e.getmessage(), e);         }     } 


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -