java.lang.Object
com.pragma.archetype.infrastructure.adapter.out.template.TemplateCache

public class TemplateCache extends Object
Local cache for downloaded templates. Stores templates in ~/.cleanarch/templates-cache/
  • Constructor Details

    • TemplateCache

      public TemplateCache()
  • Method Details

    • get

      public String get(String cacheKey)
      Gets cached template content.
      Parameters:
      cacheKey - unique key for the template (e.g., "main/templates/...")
      Returns:
      template content or null if not cached
    • put

      public void put(String cacheKey, String content)
      Stores template content in cache.
      Parameters:
      cacheKey - unique key for the template
      content - template content
    • exists

      public boolean exists(String cacheKey)
      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

      public Path getCacheDirectory()
      Gets the cache directory path.