jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r897983 - /jackrabbit/trunk/jackrabbit-jcr2dav/src/main/java/org/apache/jackrabbit/jcr2dav/Jcr2davRepositoryFactory.java
Date Mon, 11 Jan 2010 18:13:32 GMT
Author: jukka
Date: Mon Jan 11 18:13:32 2010
New Revision: 897983

URL: http://svn.apache.org/viewvc?rev=897983&view=rev
Log:
JCR-2451: Implement RepositoryFactory in jcr2dav

Return null from getRepository if the given repository URI can not be accessed.

Modified:
    jackrabbit/trunk/jackrabbit-jcr2dav/src/main/java/org/apache/jackrabbit/jcr2dav/Jcr2davRepositoryFactory.java

Modified: jackrabbit/trunk/jackrabbit-jcr2dav/src/main/java/org/apache/jackrabbit/jcr2dav/Jcr2davRepositoryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2dav/src/main/java/org/apache/jackrabbit/jcr2dav/Jcr2davRepositoryFactory.java?rev=897983&r1=897982&r2=897983&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2dav/src/main/java/org/apache/jackrabbit/jcr2dav/Jcr2davRepositoryFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2dav/src/main/java/org/apache/jackrabbit/jcr2dav/Jcr2davRepositoryFactory.java
Mon Jan 11 18:13:32 2010
@@ -25,10 +25,9 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.RepositoryFactory;
 
-import org.apache.jackrabbit.commons.GenericRepositoryFactory;
 import org.apache.jackrabbit.commons.JcrUtils;
-import org.apache.jackrabbit.jcr2spi.RepositoryImpl;
 import org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory;
+import org.apache.jackrabbit.jcr2spi.RepositoryImpl;
 import org.apache.jackrabbit.spi.RepositoryServiceFactory;
 import org.apache.jackrabbit.spi2dav.Spi2davRepositoryServiceFactory;
 import org.apache.jackrabbit.spi2davex.Spi2davexRepositoryServiceFactory;
@@ -101,9 +100,16 @@
     private Repository getRepository(
             RepositoryServiceFactory factory, Map parameters)
             throws RepositoryException {
-        return RepositoryImpl.create(
-                new Jcr2spiRepositoryFactory.RepositoryConfigImpl(
-                        factory, parameters));
+        try {
+            return RepositoryImpl.create(
+                    new Jcr2spiRepositoryFactory.RepositoryConfigImpl(
+                            factory, parameters));
+        } catch (RepositoryException e) {
+            // Unable to connect to the specified repository.
+            // Most likely the server is either not running or
+            // the given URI does not point to a valid davex server.
+            return null;
+        }
     }
 
 }



Mime
View raw message