Class FileResourceMapper

java.lang.Object
org.apache.sling.fsprovider.internal.mapper.FileResourceMapper
Direct Known Subclasses:
FileVaultResourceMapper

public class FileResourceMapper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final ContentFileCache
     
    protected final org.apache.sling.fsprovider.internal.FileStatCache
     
    protected final boolean
     
    protected final File
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileResourceMapper(String providerRoot, File providerFile, org.apache.sling.fsprovider.internal.ContentFileExtensions contentFileExtensions, ContentFileCache contentFileCache, org.apache.sling.fsprovider.internal.FileStatCache fileStatCache, boolean overlayParentResourceProvider, boolean createContentFileMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addChildren(List<Iterator<? extends org.apache.sling.api.resource.Resource>> allChildren, Iterator<org.apache.sling.api.resource.Resource> children)
     
    org.apache.sling.api.resource.Resource
    getResource(@NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, @NotNull String path, @NotNull org.apache.sling.spi.resource.provider.ResourceContext resourceContext, @Nullable org.apache.sling.api.resource.Resource parent)
    Returns a resource wrapping a file system file or folder for the given path.
    Iterator<org.apache.sling.api.resource.Resource>
    listChildren(@NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, @NotNull org.apache.sling.api.resource.Resource parent)
    Returns an iterator of resources.
    protected boolean
    resolveChildren(org.apache.sling.api.resource.ResourceResolver resolver, org.apache.sling.api.resource.Resource parent, List<Iterator<? extends org.apache.sling.api.resource.Resource>> allChildren)
     
    protected Map.Entry<org.apache.sling.api.resource.Resource,Boolean>
    resolveResource(org.apache.sling.api.resource.ResourceResolver resolver, String path)
     
    Transforms the path based on the mode.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • providerFile

      protected final File providerFile
    • contentFileCache

      protected final ContentFileCache contentFileCache
    • fileStatCache

      protected final org.apache.sling.fsprovider.internal.FileStatCache fileStatCache
    • overlayParentResourceProvider

      protected final boolean overlayParentResourceProvider
  • Constructor Details

    • FileResourceMapper

      public FileResourceMapper(String providerRoot, File providerFile, org.apache.sling.fsprovider.internal.ContentFileExtensions contentFileExtensions, ContentFileCache contentFileCache, org.apache.sling.fsprovider.internal.FileStatCache fileStatCache, boolean overlayParentResourceProvider, boolean createContentFileMapper)
  • Method Details

    • resolveResource

      protected Map.Entry<org.apache.sling.api.resource.Resource,Boolean> resolveResource(org.apache.sling.api.resource.ResourceResolver resolver, String path)
    • resolveChildren

      protected boolean resolveChildren(org.apache.sling.api.resource.ResourceResolver resolver, org.apache.sling.api.resource.Resource parent, List<Iterator<? extends org.apache.sling.api.resource.Resource>> allChildren)
    • getResource

      public org.apache.sling.api.resource.Resource getResource(@NotNull @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, @NotNull @NotNull String path, @NotNull @NotNull org.apache.sling.spi.resource.provider.ResourceContext resourceContext, @Nullable @Nullable org.apache.sling.api.resource.Resource parent)
      Returns a resource wrapping a file system file or folder for the given path. If the path is equal to the configured resource tree location of this provider, the configured file system file or folder is used for the resource. Otherwise the configured resource tree location prefix is removed from the path and the remaining relative path is used to access the file or folder. If no such file or folder exists, this method returns null.
    • addChildren

      protected void addChildren(List<Iterator<? extends org.apache.sling.api.resource.Resource>> allChildren, Iterator<org.apache.sling.api.resource.Resource> children)
    • listChildren

      public Iterator<org.apache.sling.api.resource.Resource> listChildren(@NotNull @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, @NotNull @NotNull org.apache.sling.api.resource.Resource parent)
      Returns an iterator of resources.
    • transformPath

      public String transformPath(String path)
      Transforms the path based on the mode. By default this method does nothing
      Parameters:
      path -
      Returns:
      The transformed path