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 void
clear()
Clear whole cacheContentElement
get(String path, File file)
Get content.ContentElement
get(String path, File file, ContentType contentType)
Get content.void
remove(String path)
Remove content from cache.int
size()
-
-
-
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
-
-