james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r992833 - in /james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers: AbstractSQLWhitelistMatcher.java IsInWhiteList.java
Date Sun, 05 Sep 2010 18:06:01 GMT
Author: norman
Date: Sun Sep  5 18:06:00 2010
New Revision: 992833

URL: http://svn.apache.org/viewvc?rev=992833&view=rev
Log:
Make sure the sqlFile is loaded from the right location and fix a typo..

Modified:
    james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java
    james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java?rev=992833&r1=992832&r2=992833&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java
(original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java
Sun Sep  5 18:06:00 2010
@@ -38,6 +38,7 @@ import javax.sql.DataSource;
 import org.apache.james.api.user.JamesUser;
 import org.apache.james.api.user.UsersRepository;
 import org.apache.james.services.DataSourceSelector;
+import org.apache.james.services.FileSystem;
 import org.apache.james.transport.mailets.WhiteListManager;
 import org.apache.james.util.sql.JDBCUtil;
 import org.apache.james.util.sql.SqlResources;
@@ -102,6 +103,12 @@ public abstract class AbstractSQLWhiteli
      */
     protected SqlResources sqlQueries = new SqlResources();
 
+    private FileSystem fs;
+
+    @Resource(name="filesystem")
+    public void setFilesystem(FileSystem fs) {
+        this.fs = fs;
+    }
     
     @Override
     public void init() throws MessagingException {
@@ -215,7 +222,7 @@ public abstract class AbstractSQLWhiteli
                 conn.setAutoCommit(false);
             }
             
-            this.sqlFile = new File((String) mailetContext.getAttribute("confDir"), "sqlResources.xml").getCanonicalFile();
+            this.sqlFile = fs.getFile("classpath:sqlResources.xml");
             sqlQueries.init(this.sqlFile, getSQLSectionName(), conn, getSqlParameters());
             checkTables(conn);
         } finally {

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java?rev=992833&r1=992832&r2=992833&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java
(original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java
Sun Sep  5 18:06:00 2010
@@ -73,7 +73,7 @@ public class IsInWhiteList extends Abstr
      * @see org.apache.james.transport.matchers.AbstractSQLWhitelistMatcher#getSQLSectionName()
      */
     protected String getSQLSectionName() {
-        return "Whitelist";
+        return "WhiteList";
     }
 
     /*



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message