geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r472214 - /geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Date Tue, 07 Nov 2006 19:27:28 GMT
Author: vamsic007
Date: Tue Nov  7 11:27:27 2006
New Revision: 472214

URL: http://svn.apache.org/viewvc?view=rev&rev=472214
Log:
GERONIMO-2318 Database path validation not present

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?view=diff&rev=472214&r1=472213&r2=472214
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Tue Nov  7 11:27:27 2006
@@ -1064,6 +1064,10 @@
         List list = new ArrayList();
         try {
             String[] jars = data.getJars();
+            if(jars == null) {
+                log.error("Driver load failed since no jar files were selected.");
+                return null;
+            }
             ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
 
             for (int i = 0; i < jars.length; i++) {
@@ -1109,6 +1113,18 @@
                 }
                 url = url.substring(0, begin)+url.substring(end);
             } else {
+                if(value.indexOf('\\') != -1 || value.indexOf('$') != -1) {
+                    // value contains backslash or dollar sign and needs preprocessing for
replaceAll to work properly
+                    StringBuffer temp = new StringBuffer();
+                    char[] valueChars = value.toCharArray();
+                    for(int j = 0; j < valueChars.length; ++j) {
+                        if(valueChars[j] == '\\' || valueChars[j] == '$') {
+                            temp.append('\\');
+                        }
+                        temp.append(valueChars[j]);
+                    }
+                    value = temp.toString();
+                }
                 url = url.replaceAll("\\{"+key+"\\}", value);
             }
         }



Mime
View raw message