From d1f870d4030429a2b115a0884b887ce5575150c5 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Thu, 22 Oct 2020 11:47:20 +0300 Subject: [PATCH] Inform whether global resource is found or not Signed-off-by: Pekka Helenius --- .../bookstore/config/AdditionalPropertiesConfig.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java b/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java index 7075f29..b5cea0f 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java @@ -48,6 +48,16 @@ public class AdditionalPropertiesConfig implements EnvironmentPostProcessor { classPathResources.add(new ClassPathResource("authentication.properties")); classPathResources.add(new ClassPathResource("categories.properties")); + for (Resource classPathResource : classPathResources) { + try { + classPathResource.getInputStream(); + } catch (IOException e) { + System.err.println( + "Resource " + classPathResource.getFilename() + " not found!" + ); + } + } + return classPathResources; }