You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2012/06/02 18:14:29 UTC
svn commit: r1345530 - in /sling/whiteboard/SLING-2396:
jcr.resource/src/main/java/org/apache/sling/jcr/resource/
jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/
jcr.resource/src/main/java/org/apache/sling/jcr/resource/interna...
Author: cziegeler
Date: Sat Jun 2 16:14:28 2012
New Revision: 1345530
URL: http://svn.apache.org/viewvc?rev=1345530&view=rev
Log:
SLING-2396 : Add new resource provider interfaces (WiP)
Removed:
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/starresource/
Modified:
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/LazyInputStream.java
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java
sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorTracker.java
sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceIteratorDecorator.java
sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java
sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java
sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/WrappedResourceProviderFactory.java
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java Sat Jun 2 16:14:28 2012
@@ -517,7 +517,7 @@ public class JcrPropertyMap
&& jcrValue.getType() == PropertyType.BINARY) {
ObjectInputStream ois = null;
try {
- ois = new ObjectInputStream(jcrValue.getStream(), this.dynamicClassLoader);
+ ois = new ObjectInputStream(jcrValue.getBinary().getStream(), this.dynamicClassLoader);
final Object obj = ois.readObject();
if ( type.isInstance(obj) ) {
return (T)obj;
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java Sat Jun 2 16:14:28 2012
@@ -119,7 +119,7 @@ public class JcrResourceUtil {
if(value instanceof Calendar) {
val = fac.createValue((Calendar)value);
} else if (value instanceof InputStream) {
- val = fac.createValue((InputStream)value);
+ val = fac.createValue(fac.createBinary((InputStream)value));
} else if (value instanceof Node) {
val = fac.createValue((Node)value);
} else if (value instanceof Long) {
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java Sat Jun 2 16:14:28 2012
@@ -5,9 +5,9 @@
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -53,7 +53,7 @@ public class JcrPropertyMapCacheEntry {
oos.writeObject(obj);
oos.close();
final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- value = session.getValueFactory().createValue(bais);
+ value = session.getValueFactory().createValue(session.getValueFactory().createBinary(bais));
} catch (IOException ioe) {
// we ignore this here and return null
}
@@ -123,6 +123,6 @@ public class JcrPropertyMapCacheEntry {
private boolean isDefaultValueCacheable() throws RepositoryException {
return property.getType() != PropertyType.BINARY;
}
-
-
+
+
}
\ No newline at end of file
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/LazyInputStream.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/LazyInputStream.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/LazyInputStream.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/LazyInputStream.java Sat Jun 2 16:14:28 2012
@@ -103,7 +103,7 @@ public class LazyInputStream extends Inp
private InputStream getStream() throws IOException {
if (delegatee == null) {
try {
- delegatee = value.getStream();
+ delegatee = value.getBinary().getStream();
} catch (RepositoryException re) {
throw (IOException) new IOException(re.getMessage()).initCause(re);
}
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java Sat Jun 2 16:14:28 2012
@@ -206,7 +206,7 @@ public class JcrNodeResource extends Jcr
}
if (data != null) {
- return data.getStream();
+ return data.getBinary().getStream();
}
} catch (RepositoryException re) {
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrPropertyResource.java Sat Jun 2 16:14:28 2012
@@ -221,7 +221,7 @@ public class JcrPropertyResource extends
Property prop = getProperty();
try {
- return prop.getStream();
+ return prop.getBinary().getStream();
} catch (RepositoryException re) {
LOGGER.error("getInputStream: Problem accessing the property "
+ getPath() + " stream", re);
Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java (original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java Sat Jun 2 16:14:28 2012
@@ -45,6 +45,7 @@ import org.apache.sling.api.resource.Que
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceProvider;
import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.jcr.resource.JcrResourceUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -351,6 +352,9 @@ public class JcrResourceProvider
this.checkClosed();
if ( JcrResourceProviderFactory.isAttributeVisible(name) ) {
+ if ( ResourceResolverFactory.USER.equals(name) ) {
+ return this.session.getUserID();
+ }
return session.getAttribute(name);
}
return null;
Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorTracker.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorTracker.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorTracker.java (original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceDecoratorTracker.java Sat Jun 2 16:14:28 2012
@@ -53,7 +53,9 @@ public class ResourceDecoratorTracker {
}
}
- /** Decorate a resource. */
+ /**
+ * Decorate a resource.
+ */
public Resource decorate(final Resource resource) {
Resource result = resource;
final ResourceDecorator[] decorators = this.resourceDecoratorsArray;
@@ -68,6 +70,9 @@ public class ResourceDecoratorTracker {
return result;
}
+ /**
+ * Bind a resouce decorator.
+ */
protected void bindResourceDecorator(final ResourceDecorator decorator,
final Map<String, Object> props) {
synchronized (this.resourceDecorators) {
@@ -78,6 +83,9 @@ public class ResourceDecoratorTracker {
}
}
+ /**
+ * Unbind a resouce decorator.
+ */
protected void unbindResourceDecorator(final ResourceDecorator decorator,
final Map<String, Object> props) {
synchronized (this.resourceDecorators) {
Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceIteratorDecorator.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceIteratorDecorator.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceIteratorDecorator.java (original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceIteratorDecorator.java Sat Jun 2 16:14:28 2012
@@ -37,14 +37,23 @@ public class ResourceIteratorDecorator i
this.iterator = iterator;
}
+ /**
+ * @see java.util.Iterator#hasNext()
+ */
public boolean hasNext() {
return this.iterator.hasNext();
}
+ /**
+ * @see java.util.Iterator#next()
+ */
public Resource next() {
return this.tracker.decorate(this.iterator.next());
}
+ /**
+ * @see java.util.Iterator#remove()
+ */
public void remove() {
this.iterator.remove();
}
Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java (original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java Sat Jun 2 16:14:28 2012
@@ -112,8 +112,8 @@ public class ResourceResolverImpl extend
// create the merged map
final Map<String, Object> newAuthenticationInfo = new HashMap<String, Object>();
- if (this.context.getAuthInfo() != null) {
- newAuthenticationInfo.putAll(this.context.getAuthInfo());
+ if (this.context.getAuthenticationInfo() != null) {
+ newAuthenticationInfo.putAll(this.context.getAuthenticationInfo());
}
if (authenticationInfo != null) {
newAuthenticationInfo.putAll(authenticationInfo);
@@ -607,8 +607,8 @@ public class ResourceResolverImpl extend
if (parent instanceof ResourceWrapper) {
return listChildren(((ResourceWrapper) parent).getResource());
}
- return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(), new ResourceIterator(this.context, parent,
- this.factory.getRootProviderEntry()));
+ return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(),
+ new ResourceIterator(this.context, parent, this.factory.getRootProviderEntry()));
}
// ---------- Querying resources
@@ -639,10 +639,24 @@ public class ResourceResolverImpl extend
*/
public String getUserID() {
checkClosed();
+
+ // Try auth info first
+ if ( this.context.getAuthenticationInfo() != null ) {
+ final Object impUser = this.context.getAuthenticationInfo().get(ResourceResolverFactory.USER_IMPERSONATION);
+ if ( impUser != null ) {
+ return impUser.toString();
+ }
+ final Object user = this.context.getAuthenticationInfo().get(ResourceResolverFactory.USER);
+ if ( user != null ) {
+ return user.toString();
+ }
+ }
+ // Try session
final Session session = this.getSession();
if ( session != null ) {
return session.getUserID();
}
+ // Try attributes
final Object impUser = this.getAttribute(ResourceResolverFactory.USER_IMPERSONATION);
if ( impUser != null ) {
return impUser.toString();
@@ -651,18 +665,24 @@ public class ResourceResolverImpl extend
if ( user != null ) {
return user.toString();
}
+
return null;
}
+ /** Cached session object, fetched on demand. */
private Session cachedSession;
+ /** Flag indicating if a searching has already been searched. */
private boolean searchedSession = false;
+ /**
+ * Try to get a session from one of the resource providers.
+ */
private Session getSession() {
- if ( !searchedSession ) {
- searchedSession = true;
- this.factory.getRootProviderEntry().adaptTo(this.context, Session.class);
+ if ( !this.searchedSession ) {
+ this.searchedSession = true;
+ this.cachedSession = this.factory.getRootProviderEntry().adaptTo(this.context, Session.class);
}
- return cachedSession;
+ return this.cachedSession;
}
// ---------- Adaptable interface
Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java (original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java Sat Jun 2 16:14:28 2012
@@ -28,6 +28,7 @@ import org.apache.sling.api.resource.Res
/**
* This class keeps track of the used resource providers for a
* resource resolver.
+ * Like a resource resolver itself, this class is not thread safe.
*/
public class ResourceResolverContext {
@@ -41,7 +42,7 @@ public class ResourceResolverContext {
private final boolean isAdmin;
/**
- * The original authentication information - this is used for cloning.
+ * The original authentication information - this is used for cloning and lazy logins.
*/
private final Map<String, Object> originalAuthInfo;
@@ -63,7 +64,7 @@ public class ResourceResolverContext {
/**
* Return the authentication info.
*/
- public Map<String, Object> getAuthInfo() {
+ public Map<String, Object> getAuthenticationInfo() {
return this.originalAuthInfo;
}
Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java (original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java Sat Jun 2 16:14:28 2012
@@ -67,8 +67,8 @@ public class RootResourceProviderEntry e
/** All queriable resource providers. */
private final SortedProviderList<QueriableResourceProvider> queriableProviders = new SortedProviderList<QueriableResourceProvider>(QueriableResourceProvider.class);
- /** All attribute resource providers. */
- private final SortedProviderList<AttributableResourceProvider> attributeProviders = new SortedProviderList<AttributableResourceProvider>(AttributableResourceProvider.class);
+ /** All attributable resource providers. */
+ private final SortedProviderList<AttributableResourceProvider> attributableProviders = new SortedProviderList<AttributableResourceProvider>(AttributableResourceProvider.class);
public RootResourceProviderEntry() {
super("/", null);
@@ -241,10 +241,10 @@ public class RootResourceProviderEntry e
*/
public Iterator<String> getAttributeNames(final ResourceResolverContext ctx) {
final Set<String> names = new HashSet<String>();
- if ( ctx.getAuthInfo() != null ) {
- names.addAll(ctx.getAuthInfo().keySet());
+ if ( ctx.getAuthenticationInfo() != null ) {
+ names.addAll(ctx.getAuthenticationInfo().keySet());
}
- final Iterator<AttributableResourceProvider> i = this.attributeProviders.getProviders(ctx);
+ final Iterator<AttributableResourceProvider> i = this.attributableProviders.getProviders(ctx);
while ( i.hasNext() ) {
final AttributableResourceProvider adap = i.next();
final Collection<String> newNames = adap.getAttributeNames();
@@ -264,11 +264,11 @@ public class RootResourceProviderEntry e
public Object getAttribute(final ResourceResolverContext ctx, final String name) {
Object result = null;
if (!FORBIDDEN_ATTRIBUTE.equals(name) ) {
- if (ctx.getAuthInfo() != null) {
- result = ctx.getAuthInfo().get(name);
+ if (ctx.getAuthenticationInfo() != null) {
+ result = ctx.getAuthenticationInfo().get(name);
}
if ( result == null ) {
- final Iterator<AttributableResourceProvider> i = this.attributeProviders.getProviders(ctx);
+ final Iterator<AttributableResourceProvider> i = this.attributableProviders.getProviders(ctx);
while ( result == null && i.hasNext() ) {
final AttributableResourceProvider adap = i.next();
result = adap.getAttribute(name);
@@ -290,7 +290,7 @@ public class RootResourceProviderEntry e
this.queriableProviders.add((QueriableResourceProvider)provider);
}
if ( provider instanceof AttributableResourceProvider ) {
- this.attributeProviders.add((AttributableResourceProvider)provider);
+ this.attributableProviders.add((AttributableResourceProvider)provider);
}
}
@@ -306,7 +306,7 @@ public class RootResourceProviderEntry e
this.queriableProviders.remove((QueriableResourceProvider)provider);
}
if ( provider instanceof AttributableResourceProvider ) {
- this.attributeProviders.remove((AttributableResourceProvider)provider);
+ this.attributableProviders.remove((AttributableResourceProvider)provider);
}
}
@@ -319,7 +319,7 @@ public class RootResourceProviderEntry e
this.bindWrapper(wrapper);
this.adaptableProviders.add(wrapper);
this.queriableProviders.add(wrapper);
- this.attributeProviders.add(wrapper);
+ this.attributableProviders.add(wrapper);
final boolean required = PropertiesUtil.toBoolean(props.get(ResourceProviderFactory.PROPERTY_REQUIRED), false);
if (required) {
@@ -341,7 +341,7 @@ public class RootResourceProviderEntry e
this.unbindWrapper(new WrappedResourceProvider(null, props));
this.adaptableProviders.remove(wrapper);
this.queriableProviders.remove(wrapper);
- this.attributeProviders.remove(wrapper);
+ this.attributableProviders.remove(wrapper);
final boolean required = PropertiesUtil.toBoolean(props.get(ResourceProviderFactory.PROPERTY_REQUIRED), false);
if (required) {
Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/WrappedResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/WrappedResourceProviderFactory.java?rev=1345530&r1=1345529&r2=1345530&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/WrappedResourceProviderFactory.java (original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/WrappedResourceProviderFactory.java Sat Jun 2 16:14:28 2012
@@ -157,9 +157,9 @@ public class WrappedResourceProviderFact
public ResourceProvider login(final ResourceResolverContext ctx) throws LoginException {
final ResourceProvider rp;
if (ctx.isAdmin()) {
- rp = this.resourceProviderFactory.getAdministrativeResourceProvider(ctx.getAuthInfo());
+ rp = this.resourceProviderFactory.getAdministrativeResourceProvider(ctx.getAuthenticationInfo());
} else {
- rp = this.resourceProviderFactory.getResourceProvider(ctx.getAuthInfo());
+ rp = this.resourceProviderFactory.getResourceProvider(ctx.getAuthenticationInfo());
}
ctx.addFactoryResourceProvider(this.getKey(), rp);
return rp;