Class ContentFileCache
- java.lang.Object
-
- org.apache.sling.fsprovider.internal.parser.ContentFileCache
-
public final class ContentFileCache extends Object
Cache for parsed content from content files (e.g. JSON, JCR XML).
-
-
Constructor Summary
Constructors Constructor Description ContentFileCache(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear whole cacheContentElementget(String path, File file)Get content.ContentElementget(String path, File file, ContentType contentType)Get content.voidremove(String path)Remove content from cache.intsize()
-
-
-
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- FilecontentType- 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
-
-