Class ImageDownloader

java.lang.Object
com.atlassian.bamboo.plugins.lookandfeel.ImageDownloader

public class ImageDownloader extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 request
      resp - The response
      filename - 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.