changeset 1157:2a976f71311f

more accurate file paths in dlConfig.jsp.
author robcast
date Fri, 22 Feb 2013 18:23:38 +0100
parents 8d6249eab52b
children 29e86ae1e3b2
files webapp/src/main/webapp/server/dlConfig.jsp
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/server/dlConfig.jsp	Fri Feb 22 17:40:00 2013 +0100
+++ b/webapp/src/main/webapp/server/dlConfig.jsp	Fri Feb 22 18:23:38 2013 +0100
@@ -45,15 +45,26 @@
     int l = keys.length;
     for (int i = 0; i < l; i++) {
         String key = (String) keys[i];
-       	String val = dlConfig.getAsString(key);
+       	digilib.util.Parameter param = dlConfig.get(key);
+        String val;
         if (key.equals("basedir-list")) {
-            String[] bd = (String[]) dlConfig.getValue("basedir-list");
+            String[] bd = (String[]) param.getValue();
             val = "";
             if (bd != null) {
                 for (int j = 0; j < bd.length; j++) {
                     val += bd[j] + "<br> ";
                 }
             }
+        } else if (param.getValue() instanceof java.io.File) {
+            java.io.File f = (java.io.File) param.getValue();
+            if (!f.isAbsolute()) {
+                // relative path -> use getRealPath to resolve
+                val = pageContext.getServletContext().getRealPath(f.getPath());
+            } else {
+                val = f.toString();
+            }
+        } else {
+            val = param.getAsString();
         }
         if (val.length() == 0) {
             val = "(none)";