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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -