FileDocCategorySizeDatePackage
FileClientSessionCache.javaAPI DocAndroid 1.5 API12893Wed May 06 22:41:06 BST 2009org.apache.harmony.xnet.provider.jsse

FileClientSessionCache

public class FileClientSessionCache extends Object
File-based cache implementation. Only one process should access the underlying directory at a time.

Fields Summary
static final int
MAX_SIZE
static final Logger
logger
static final Map
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.
Constructors Summary
private FileClientSessionCache()


      
Methods Summary
static synchronized voidreset()
For testing.

        caches.clear();
    
public static synchronized SSLClientSessionCacheusingDirectory(java.io.File directory)
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


                                                                   
        
                
        FileClientSessionCache.Impl cache = caches.get(directory);
        if (cache == null) {
            cache = new FileClientSessionCache.Impl(directory);
            caches.put(directory, cache);
        }
        return cache;