db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r365724 - /db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java
Date Tue, 03 Jan 2006 19:55:06 GMT
Author: mvdb
Date: Tue Jan  3 11:55:03 2006
New Revision: 365724

URL: http://svn.apache.org/viewcvs?rev=365724&view=rev
Log:
Make propFile try to load from file system if not found in the classloader.

Modified:
    db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java?rev=365724&r1=365723&r2=365724&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java Tue Jan  3
11:55:03 2006
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+import java.io.FileInputStream;
+import java.io.InputStream;
 import java.io.StringReader;
 import java.util.Iterator;
 import java.util.Map;
@@ -72,7 +74,11 @@
 
         try
         {
-            props.load(getClass().getResourceAsStream(propFile));
+            InputStream propStream = getClass().getResourceAsStream(propFile);
+            if (propStream == null) {
+                propStream = new FileInputStream(propFile);
+            }
+            props.load(propStream);
 
             String dataSourceClass = props.getProperty(DATASOURCE_PROPERTY_PREFIX + "class",
BasicDataSource.class.getName());
 



Mime
View raw message