Browse Source

Replace getFile() with getInputStream(), required by WAR deployment

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
a688cdd3ec
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java

+ 8
- 1
bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java View File

@ -69,7 +69,14 @@ public class AdditionalPropertiesConfig implements EnvironmentPostProcessor {
for (String prefix : resourceFilePrefixes) {
try {
ClassPathResource classPathResource = new ClassPathResource(prefix + "-" + profile + ".properties");
classPathResource.getFile().canRead();
/*
* Do not use getFile() method.
* Instead, use getInputStream(), required by Tomcat/WAR deployment
*/
classPathResource.getInputStream();
classPathResources.add(classPathResource);
System.out.printf(
"Profile properties file found: %s\n",


Loading…
Cancel
Save