Class AuthenticatedResourceProvider


  • public class AuthenticatedResourceProvider
    extends Object
    This AuthenticatedResourceProvider implementation keeps a resource provider and the authentication information (through the ResolveContext). The methods are similar to those of ResourceProvider.
    • Constructor Detail

      • AuthenticatedResourceProvider

        public AuthenticatedResourceProvider​(@NotNull
                                             @NotNull ResourceProviderHandler providerHandler,
                                             boolean useRAS,
                                             @NotNull
                                             @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> resolveContext,
                                             @NotNull
                                             @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker)
        Constructor
        Parameters:
        providerHandler -
        useRAS -
        resolveContext -
        tracker -
    • Method Detail

      • getResolveContext

        @NotNull
        public @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> getResolveContext()
        Get the resolve context.
        Returns:
        The resolve context
      • refresh

        public void refresh()
        See Also:
        ResourceProvider.refresh(ResolveContext)
      • isLive

        public boolean isLive()
        Check if the provider is live
        Returns:
        true If live
        See Also:
        ResourceProvider.isLive(ResolveContext)
      • getParent

        public org.apache.sling.api.resource.Resource getParent​(org.apache.sling.api.resource.Resource child)
        Get the parent resource
        Parameters:
        child - The child
        Returns:
        The parent
        See Also:
        ResourceProvider.getParent(ResolveContext, Resource)
      • getResource

        public org.apache.sling.api.resource.Resource getResource​(String path,
                                                                  org.apache.sling.api.resource.Resource parent,
                                                                  Map<String,​String> parameters)
        See Also:
        ResourceProvider.getResource(ResolveContext, String, ResourceContext, Resource)
      • listChildren

        public Iterator<org.apache.sling.api.resource.Resource> listChildren​(org.apache.sling.api.resource.Resource parent)
        See Also:
        ResourceProvider.listChildren(ResolveContext, Resource)
      • getAttributeNames

        public void getAttributeNames​(Set<String> attributeNames)
        See Also:
        ResourceProvider.getAttributeNames(ResolveContext)
      • getAttribute

        public Object getAttribute​(String name)
        See Also:
        ResourceProvider.getAttribute(ResolveContext, String)
      • create

        public org.apache.sling.api.resource.Resource create​(org.apache.sling.api.resource.ResourceResolver resolver,
                                                             String path,
                                                             Map<String,​Object> properties)
                                                      throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
        See Also:
        ResourceProvider.create(ResolveContext, String, Map)
      • orderBefore

        public boolean orderBefore​(@NotNull
                                   @NotNull org.apache.sling.api.resource.Resource parent,
                                   @NotNull
                                   @NotNull String name,
                                   @Nullable
                                   @Nullable String followingSiblingName)
                            throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
        See Also:
        ResourceProvider.orderBefore(ResolveContext, Resource, String, String)
      • delete

        public void delete​(org.apache.sling.api.resource.Resource resource)
                    throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
        See Also:
        ResourceProvider.delete(ResolveContext, Resource)
      • revert

        public void revert()
        See Also:
        ResourceProvider.revert(ResolveContext)
      • commit

        public void commit()
                    throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
        See Also:
        ResourceProvider.commit(ResolveContext)
      • hasChanges

        public boolean hasChanges()
        See Also:
        ResourceProvider.hasChanges(ResolveContext)
      • getSupportedLanguages

        public String[] getSupportedLanguages()
        See Also:
        QueryLanguageProvider.getSupportedLanguages(ResolveContext)
      • findResources

        public Iterator<org.apache.sling.api.resource.Resource> findResources​(String query,
                                                                              String language)
        See Also:
        QueryLanguageProvider.findResources(ResolveContext, String, String)
      • queryResources

        public Iterator<Map<String,​Object>> queryResources​(String query,
                                                                 String language)
        See Also:
        QueryLanguageProvider.queryResources(ResolveContext, String, String)
      • adaptTo

        public <AdapterType> AdapterType adaptTo​(Class<AdapterType> type)
        See Also:
        ResourceProvider.adaptTo(ResolveContext, Class)
      • copy

        public boolean copy​(String srcAbsPath,
                            String destAbsPath)
                     throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
        See Also:
        ResourceProvider.copy(ResolveContext, String, String)
      • move

        public boolean move​(String srcAbsPath,
                            String destAbsPath)
                     throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
        See Also:
        ResourceProvider.move(ResolveContext, String, String)