jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r433251 - /jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Date Mon, 21 Aug 2006 14:15:09 GMT
Author: mreutegg
Date: Mon Aug 21 07:15:08 2006
New Revision: 433251

URL: http://svn.apache.org/viewvc?rev=433251&view=rev
Log:
Use JCR SimpleCredentials if available.

Modified:
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java

Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=433251&r1=433250&r2=433251&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Mon Aug 21 07:15:08 2006
@@ -142,6 +142,7 @@
 import javax.jcr.PropertyType;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
+import javax.jcr.SimpleCredentials;
 import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -216,6 +217,10 @@
         UsernamePasswordCredentials creds;
         if (credentials == null) {
             creds = new UsernamePasswordCredentials(null, null);
+        } else if (credentials instanceof SimpleCredentials) {
+            SimpleCredentials sCred = (SimpleCredentials) credentials;
+            creds = new UsernamePasswordCredentials(sCred.getUserID(), 
+                    String.valueOf(sCred.getPassword()));
         } else {
             // TODO properly build http client credentials
             creds = new UsernamePasswordCredentials(credentials.toString());



Mime
View raw message