Class TemplateCache
java.lang.Object
com.pragma.archetype.infrastructure.adapter.out.template.TemplateCache
Local cache for downloaded templates.
Stores templates in ~/.cleanarch/templates-cache/
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all cached templates.booleanChecks if a template is cached.Gets cached template content.Gets the cache directory path.longGets the size of the cache in bytes.voidStores template content in cache.
-
Constructor Details
-
TemplateCache
public TemplateCache()
-
-
Method Details
-
get
Gets cached template content.- Parameters:
cacheKey- unique key for the template (e.g., "main/templates/...")- Returns:
- template content or null if not cached
-
put
Stores template content in cache.- Parameters:
cacheKey- unique key for the templatecontent- template content
-
exists
Checks if a template is cached.- Parameters:
cacheKey- unique key for the template- Returns:
- true if cached, false otherwise
-
clear
public void clear()Clears all cached templates. -
getCacheSize
public long getCacheSize()Gets the size of the cache in bytes. -
getCacheDirectory
Gets the cache directory path.
-