Author: fmeschbe
Date: Fri Jan 18 11:15:01 2008
New Revision: 613228
URL: http://svn.apache.org/viewvc?rev=613228&view=rev
Log:
SLING-159 temporary workaround for Session.itemExists throwing a
RepositoryException
for malformed paths such as /b/c/*
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java?rev=613228&r1=613227&r2=613228&view=diff
==============================================================================
---
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
(original)
+++
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
Fri Jan 18 11:15:01 2008
@@ -307,7 +307,17 @@
// assume this session has more access rights than the client Session
String workSpace = clientSession.getWorkspace().getName();
Session adminSession = getAdminSession(workSpace);
- return adminSession.itemExists(path);
+
+ // SLING-159: Workaround for method throwing when called with
+ // a malformed path
+ try {
+ return adminSession.itemExists(path);
+ } catch (RepositoryException re) {
+ log.info(
+ "itemReallyExists: Error checking for existence of {}: {}",
+ path, re.toString());
+ return false;
+ }
}
/** Returns the MIME type from the MimeTypeService for the given name */