jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r530119 - /jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/SimpleWebdavServlet.java
Date Wed, 18 Apr 2007 18:30:28 GMT
Author: jukka
Date: Wed Apr 18 11:30:27 2007
New Revision: 530119

URL: http://svn.apache.org/viewvc?view=rev&rev=530119
Log:
JCR-847: Added a getCredentialsProvider() factory method based on a patch from Claus Köll.
Thanks!

Modified:
    jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/SimpleWebdavServlet.java

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/SimpleWebdavServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/SimpleWebdavServlet.java?view=diff&rev=530119&r1=530118&r2=530119
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/SimpleWebdavServlet.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/SimpleWebdavServlet.java
Wed Apr 18 11:30:27 2007
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.server.AbstractWebdavServlet;
 import org.apache.jackrabbit.server.BasicCredentialsProvider;
+import org.apache.jackrabbit.server.CredentialsProvider;
 import org.apache.jackrabbit.server.SessionProvider;
 import org.apache.jackrabbit.server.SessionProviderImpl;
 import org.apache.jackrabbit.webdav.DavLocatorFactory;
@@ -277,12 +278,23 @@
      */
     public synchronized SessionProvider getSessionProvider() {
         if (sessionProvider == null) {
-            sessionProvider = new SessionProviderImpl(
-                new BasicCredentialsProvider(
-                    getInitParameter(INIT_PARAM_MISSING_AUTH_MAPPING))
-            );
+            sessionProvider = new SessionProviderImpl(getCredentialsProvider());
         }
         return sessionProvider;
+    }
+
+    /**
+     * Factory method for creating the credentials provider to be used for
+     * accessing the credentials associated with a request. The default
+     * implementation returns a {@link BasicCredentialsProvider} instance,
+     * but subclasses can override this method to add support for other
+     * types of credentials.
+     *
+     * @return the credentilas provider
+     * @since 1.3
+     */
+    protected CredentialsProvider getCredentialsProvider() {
+    	return new BasicCredentialsProvider(getInitParameter(INIT_PARAM_MISSING_AUTH_MAPPING));
     }
 
     /**



Mime
View raw message