geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r472080 - /geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Date Tue, 07 Nov 2006 12:20:03 GMT
Author: vamsic007
Date: Tue Nov  7 04:20:02 2006
New Revision: 472080

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

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

Modified: geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?view=diff&rev=472080&r1=472079&r2=472080
==============================================================================
--- geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
(original)
+++ geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Tue Nov  7 04:20:02 2006
@@ -1057,6 +1057,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++) {
@@ -1102,6 +1106,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