Class ImageDownloader
java.lang.Object
com.atlassian.bamboo.plugins.lookandfeel.ImageDownloader
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addCachingHeaders
(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Set 'expire' headers to cache for one year.static void
doDownload
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String filename, boolean shouldClose) Sends an image to the ServletResponse output stream.
-
Constructor Details
-
ImageDownloader
public ImageDownloader()
-
-
Method Details
-
doDownload
public static void doDownload(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String filename, boolean shouldClose) throws IOException Sends an image to the ServletResponse output stream.- Parameters:
req
- The requestresp
- The responsefilename
- The name of the image you want to download.shouldClose
- Whether the output stream should be closed or not- Throws:
IOException
-
addCachingHeaders
public static void addCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Set 'expire' headers to cache for one year. Also adds the additional cache control values passed in. Note, this method resets the cache control headers if set previously. If caches are disabled (via the system property atlassian.disable.caches), this method sets 'expires' to 0.
-