Module platform

Class ThumbnailCache

java.lang.Object
de.grogra.pf.ui.ThumbnailCache

public class ThumbnailCache extends Object
Flat-file cache for project scene thumbnails.

Cache directory: ~/.grogra.de-platform/thumbnails/
Cache key: <stem>_<crc32hex(absolutePath)>.png

Only exists(java.io.File) is called at startup (O(1) File.exists() check). JEditorPane loads PNG bytes lazily via file:// URIs — zero startup overhead.

Author:
MH at YNL 2026
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    exists(File gszPath)
    Returns true if a cached thumbnail exists for the given project file.
    static byte[]
    get(File gszPath)
    Returns cached PNG bytes, or null if absent.
    static File
    getCacheFile(File gszPath)
    Returns the cache file path for the given .gsz file.
    static void
    put(File gszPath, byte[] png)
    Writes PNG bytes to the cache, creating the cache directory if needed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ThumbnailCache

      public ThumbnailCache()
  • Method Details

    • getCacheFile

      public static File getCacheFile(File gszPath)
      Returns the cache file path for the given .gsz file. The file may not exist yet.
    • put

      public static void put(File gszPath, byte[] png) throws IOException
      Writes PNG bytes to the cache, creating the cache directory if needed.
      Throws:
      IOException
    • get

      public static byte[] get(File gszPath) throws IOException
      Returns cached PNG bytes, or null if absent.
      Throws:
      IOException
    • exists

      public static boolean exists(File gszPath)
      Returns true if a cached thumbnail exists for the given project file.