com.atlassian.plugin.servlet
Class ResourceDownloadUtils

java.lang.Object
  extended by com.atlassian.plugin.servlet.ResourceDownloadUtils

public class ResourceDownloadUtils
extends Object


Constructor Summary
ResourceDownloadUtils()
           
 
Method Summary
static void addCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          Deprecated. Please use addPublicCachingHeaders(HttpServletRequest, HttpServletResponse) or addPrivateCachingHeaders(HttpServletRequest, HttpServletResponse) instead.
static void addCachingHeaders(javax.servlet.http.HttpServletResponse httpServletResponse, String... cacheControls)
          Set 'expire' headers to cache for one year.
static void addPrivateCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          Sets caching headers with private cache control.
static void addPublicCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          Sets caching headers with public cache control.
static void serveFileImpl(javax.servlet.http.HttpServletResponse httpServletResponse, InputStream in)
          Deprecated. Since 2.0. Use IOUtils.copy(InputStream, OutputStream) instead. The method calling this should be responsible for closing streams and flushing if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceDownloadUtils

public ResourceDownloadUtils()
Method Detail

serveFileImpl

@Deprecated
public static void serveFileImpl(javax.servlet.http.HttpServletResponse httpServletResponse,
                                            InputStream in)
                          throws IOException
Deprecated. Since 2.0. Use IOUtils.copy(InputStream, OutputStream) instead. The method calling this should be responsible for closing streams and flushing if necessary.

Throws:
IOException

addCachingHeaders

public static void addCachingHeaders(javax.servlet.http.HttpServletResponse httpServletResponse,
                                     String... cacheControls)
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.


addCachingHeaders

@Deprecated
public static void addCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                javax.servlet.http.HttpServletResponse httpServletResponse)
Deprecated. Please use addPublicCachingHeaders(HttpServletRequest, HttpServletResponse) or addPrivateCachingHeaders(HttpServletRequest, HttpServletResponse) instead.

Set 'expire' headers to cache for one year, with public caching turned on.


addPublicCachingHeaders

public static void addPublicCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest,
                                           javax.servlet.http.HttpServletResponse httpServletResponse)
Sets caching headers with public cache control. Applications should call this method from urlrewrite.xml to decorate urls like /s/{build num}/.../_/resourceurl.

See Also:
http://tuckey.org/urlrewrite/manual/2.6/

addPrivateCachingHeaders

public static void addPrivateCachingHeaders(javax.servlet.http.HttpServletRequest httpServletRequest,
                                            javax.servlet.http.HttpServletResponse httpServletResponse)
Sets caching headers with private cache control. Applications should call this method from urlrewrite.xml to decorate urls like /sp/{build num}/.../_/resourceurl.

See Also:
http://tuckey.org/urlrewrite/manual/2.6/


Copyright © 2011 Atlassian. All Rights Reserved.