Class ContentFileCache


  • public final class ContentFileCache
    extends Object
    Cache for parsed content from content files (e.g. JSON, JCR XML).
    • Constructor Detail

      • ContentFileCache

        public ContentFileCache​(int maxSize)
        Parameters:
        maxSize - Cache size. 0 = caching disabled.
    • Method Detail

      • get

        public ContentElement get​(String path,
                                  File file)
        Get content.
        Parameters:
        path - Path (used as cache key).
        file - File
        Returns:
        Content or null
      • get

        public ContentElement get​(String path,
                                  File file,
                                  ContentType contentType)
        Get content.
        Parameters:
        path - Path (used as cache key).
        file - File
        contentType - Content type - if null type is auto-detected
        Returns:
        Content or null
      • remove

        public void remove​(String path)
        Remove content from cache.
        Parameters:
        path - Path (used as cache key)
      • clear

        public void clear()
        Clear whole cache
      • size

        public int size()
        Returns:
        Current cache size