View Javadoc

1   package com.atlassian.plugin.cache.filecache.impl;
2   
3   import com.atlassian.plugin.cache.filecache.FileCache;
4   import com.atlassian.plugin.cache.filecache.FileCacheStreamProvider;
5   import com.atlassian.plugin.servlet.DownloadException;
6   
7   import java.io.OutputStream;
8   
9   /**
10   * Always streams each resource from the given input
11   * @since v2.13
12   */
13  public class PassThroughFileCache<K> implements FileCache<K> {
14      public static <K>PassThroughFileCache<K> instance() {
15          return new PassThroughFileCache<K>();
16      }
17  
18      @Override
19      public void stream(K key, OutputStream dest, FileCacheStreamProvider input) throws DownloadException {
20          input.writeStream(dest);
21      }
22  
23      @Override
24      public void clear() {
25      }
26  }