Package org.conscrypt

Class FileClientSessionCache

java.lang.Object
org.conscrypt.FileClientSessionCache

@Internal public final class FileClientSessionCache extends Object
File-based cache implementation. Only one process should access the underlying directory at a time.
  • Field Details

    • logger

      private static final Logger logger
    • MAX_SIZE

      public static final int MAX_SIZE
      See Also:
    • caches

      static final Map<File,FileClientSessionCache.Impl> caches
      Maps directories to the cache instances that are backed by those directories. We synchronize access using the cache instance, so it's important that everyone shares the same instance.
  • Constructor Details

    • FileClientSessionCache

      private FileClientSessionCache()
  • Method Details

    • usingDirectory

      public static SSLClientSessionCache usingDirectory(File directory) throws IOException
      Returns a cache backed by the given directory. Creates the directory (including parent directories) if necessary. This cache should have exclusive access to the given directory.
      Parameters:
      directory - to store files in
      Returns:
      a cache backed by the given directory
      Throws:
      IOException - if the file exists and is not a directory or if creating the directories fails
    • reset

      static void reset()
      For testing.