com.atlassian.plugin.cache.filecache.impl
Class PassThroughFileCache<K>

java.lang.Object
  extended by com.atlassian.plugin.cache.filecache.impl.PassThroughFileCache<K>
All Implemented Interfaces:
FileCache<K>

public class PassThroughFileCache<K>
extends Object
implements FileCache<K>

Always streams each resource from the given input

Since:
v2.13

Constructor Summary
PassThroughFileCache()
           
 
Method Summary
 void clear()
          Remove all entries in the cache.
static
<K> PassThroughFileCache<K>
instance()
           
 void stream(K key, OutputStream dest, FileCacheStreamProvider input)
          Stream the contents identified by the key to the destination stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassThroughFileCache

public PassThroughFileCache()
Method Detail

instance

public static <K> PassThroughFileCache<K> instance()

stream

public void stream(K key,
                   OutputStream dest,
                   FileCacheStreamProvider input)
            throws DownloadException
Description copied from interface: FileCache
Stream the contents identified by the key to the destination stream. Should the contents not exist in the cache a new entry should be created if the implementation is a caching implementation.

Specified by:
stream in interface FileCache<K>
Parameters:
key - can not be null
dest - where to write the cached item to
input - provides the underlying item on a cache-miss
Throws:
DownloadException - if there was an error writing to dest, or reading from input, or reading from the cache

clear

public void clear()
Description copied from interface: FileCache
Remove all entries in the cache.

Specified by:
clear in interface FileCache<K>


Copyright © 2013 Atlassian. All Rights Reserved.