public static synchronized SSLClientSessionCache usingDirectory(File directory)
            throws IOException {
        FileClientSessionCache.Impl cache = caches.get(directory);
        if (cache == null) {
            cache = new FileClientSessionCache.Impl(directory);
            caches.put(directory, cache);
        }
        return cache;
    }
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.

@param directory to store files in
@return a cache backed by the given directory
@throws IOException if the file exists and is not a directory or if
 creating the directories fails
common/src/main/java/org/conscrypt/FileClientSessionCache.java