geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1126321 - /geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/DatabaseInitializationGBean.java
Date Mon, 23 May 2011 05:27:48 GMT
Author: xiaming
Date: Mon May 23 05:27:48 2011
New Revision: 1126321

URL: http://svn.apache.org/viewvc?rev=1126321&view=rev
Log:
GERONIMO-5890 use bundle.getEntry() to search resource

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/DatabaseInitializationGBean.java

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/DatabaseInitializationGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/DatabaseInitializationGBean.java?rev=1126321&r1=1126320&r2=1126321&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/DatabaseInitializationGBean.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/DatabaseInitializationGBean.java
Mon May 23 05:27:48 2011
@@ -125,22 +125,29 @@ public class DatabaseInitializationGBean
 
     }
 
-    private Reader getSQLInput(String sqlString, String path, Bundle bundle) throws Exception
{
-        if (sqlString != null) {
-            return new StringReader(sqlString);
-        } else if (path != null) {
-            URL resource = bundle.getResource(path);
-            if (resource == null) {
-                File file = new File(path);
-                if (!file.exists()) {
-                    throw new Exception("SQL resource file not found: " + path);
-                }
-                return new InputStreamReader(new FileInputStream(file));
-            } else {
-                return new InputStreamReader(resource.openStream());
-            }            
-        } else {
-            throw new Exception("SQL resource file or string not specified");
-        }
-    }
+	private Reader getSQLInput(String sqlString, String path, Bundle bundle)
+			throws Exception {
+		if (sqlString != null) {
+			return new StringReader(sqlString);
+		} else if (path != null) {
+			URL resource = bundle.getResource(path);
+			if (resource == null) {
+				resource = bundle.getEntry(path);
+				if (resource != null) {
+					return new InputStreamReader(resource.openStream());
+				} else {
+					File file = new File(path);
+					if (!file.exists()) {
+						throw new Exception("SQL resource file not found: "
+								+ path);
+					}
+					return new InputStreamReader(new FileInputStream(file));
+				}
+			} else {
+				return new InputStreamReader(resource.openStream());
+			}
+		} else {
+			throw new Exception("SQL resource file or string not specified");
+		}
+	}
 }



Mime
View raw message