Interface ApiResourceProvider

    • Method Detail

      • getResource

        Resource getResource​(ResourceResolver resourceResolver,
                             java.lang.String path)
        Returns a resource from this resource provider or null if the resource provider cannot find it. The path does not come with any prefix.
        Parameters:
        resourceResolver - The ResourceResolver to which the returned Resource is attached.
        path - The resource path.
        Returns:
        null If this provider does not have a resource for the path.
      • listChildren

        java.util.Iterator<Resource> listChildren​(Resource parent)
        Returns an java.util.Iterator of Resource objects loaded from the children of the given Resource. The returned Resource instances are attached to the same ResourceResolver as the given parent resource.

        The returned iterator may in turn contain resources which do not actually exist but are required to traverse the resource tree. Such resources SHOULD be SyntheticResource objects whose resource type MUST be set to ResourceProvider.RESOURCE_TYPE_SYNTHETIC.

        Parameters:
        parent - The Resource whose children are requested.
        Returns:
        An Iterator of Resource objects or null if the resource provider has no children for the given resource.
        Throws:
        java.lang.NullPointerException - If parent is null.
      • create

        Resource create​(ResourceResolver resolver,
                        java.lang.String path,
                        java.util.Map<java.lang.String,​java.lang.Object> properties)
                 throws PersistenceException
        Create a new resource at the given path. The new resource is put into the transient space of the bound resource provider until its ResourceResolver.commit() is called.
        Parameters:
        resolver - The current resource resolver.
        path - The resource path.
        properties - Optional properties
        Returns:
        The new resource.
        Throws:
        PersistenceException - If anything fails