1 package com.atlassian.plugin.cache.filecache;
2
3 import com.atlassian.plugin.servlet.DownloadException;
4
5 import java.io.OutputStream;
6
7 /**
8 * Interface used by the file caching system. Items wishing to participate in file caching will need to
9 * implement this interface. This interface gives the file cache a means to get hold of the contents that will be cached.
10 * @since v2.13
11 */
12 public interface FileCacheStreamProvider {
13 /**
14 * Produce the complete stream and write to the designated output stream. Classes implementing this method should not
15 * close the output stream.
16 *
17 * @param dest designated output stream.
18 * @throws DownloadException If something goes awry while writing the file.
19 */
20 void writeStream(OutputStream dest) throws DownloadException;
21 }