]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/BasePizzaServiceSystem.java
Added more thrown exceptions
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / BasePizzaServiceSystem.java
index 0e0e754137d467df1df9eb94b69189cbb98540f4..031f2f92997823dd4d4470b6bef28abd46210933 100644 (file)
@@ -40,7 +40,19 @@ public class BasePizzaServiceSystem extends BaseFrameworkSystem {
                        this.getLogger().debug(MessageFormat.format("name={0}", name));
 
                        // Get value
-                       String value = context.getInitParameter(name).trim();
+                       String value = context.getInitParameter(name);
+
+                       // Debug message
+                       this.getLogger().debug(MessageFormat.format("value={0}", value));
+
+                       // Is it null?
+                       if (value == null) {
+                               // Value is null
+                               throw new NullPointerException(MessageFormat.format("value for {0} is null, maybe invalid context parameter?", name));
+                       } else if (name.equals("database.backend.storagepath")) {
+                               // Need to expand this path
+                               value = context.getRealPath(String.format("../../%s", value.trim()));
+                       }
 
                        // Debug log
                        this.getLogger().debug(MessageFormat.format("{0}={1}", name, value));