Class ContentFile

java.lang.Object
org.apache.sling.fsprovider.internal.mapper.ContentFile

public final class ContentFile extends Object
Reference to a file that contains a content fragment (e.g. JSON, JCR XML).
  • Constructor Details

    • ContentFile

      public ContentFile(File file, String path, String subPath, ContentFileCache contentFileCache)
      Parameters:
      file - File with content fragment
      path - Root path of the content file
      subPath - Relative path addressing content fragment inside file
      contentFileCache - Content file cache
    • ContentFile

      public ContentFile(File file, String path, String subPath, ContentFileCache contentFileCache, ContentType contentType)
      Parameters:
      file - File with content fragment
      path - Root path of the content file
      subPath - Relative path addressing content fragment inside file
      contentFileCache - Content file cache
      contentType - Content type
  • Method Details

    • getFile

      public File getFile()
      Returns:
      File with content fragment
    • getPath

      public String getPath()
      Returns:
      Root path of content file
    • getSubPath

      public String getSubPath()
      Returns:
      Relative path addressing content fragment inside file
    • getContent

      public ContentElement getContent()
      Content object referenced by sub path.
      Returns:
      Map if resource, property value if property.
    • hasContent

      public boolean hasContent()
      Returns:
      true if any content was found.
    • getValueMap

      public ValueMap getValueMap()
      Returns:
      ValueMap for resource. Never null.
    • getChildren

      public Iterator<Map.Entry<String,ContentElement>> getChildren()
      Returns:
      Child maps.