com.atlassian.plugin.servlet
Class PluginResourceDownload

java.lang.Object
  extended by com.atlassian.plugin.servlet.PluginResourceDownload
All Implemented Interfaces:
DownloadStrategy

public class PluginResourceDownload
extends java.lang.Object
implements DownloadStrategy

A downloadable plugin resource, as described here: http://confluence.atlassian.com/display/JIRA/Downloadable+plugin+resource It supports the download of single plugin resources as well as batching.

The URL that it parses for a single resource looks like this:
{server root}/download/resources/{plugin key}:{module key}/{resource name} The URL that it parses for a batch looks like this:
{server root}/download/batch/{plugin key}:{module key}/all.css?ieonly=true


Constructor Summary
PluginResourceDownload()
           
PluginResourceDownload(PluginResourceLocator pluginResourceLocator, ContentTypeResolver contentTypeResolver, java.lang.String characterEncoding)
           
 
Method Summary
 boolean matches(java.lang.String urlPath)
          Returns true if the DownloadStrategy is supported for the given url path.
 void serveFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Serves the file for the given request and response.
 void setCharacterEncoding(java.lang.String characterEncoding)
           
 void setContentTypeResolver(ContentTypeResolver contentTypeResolver)
           
 void setPluginResourceLocator(PluginResourceLocator pluginResourceLocator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginResourceDownload

public PluginResourceDownload()

PluginResourceDownload

public PluginResourceDownload(PluginResourceLocator pluginResourceLocator,
                              ContentTypeResolver contentTypeResolver,
                              java.lang.String characterEncoding)
Method Detail

matches

public boolean matches(java.lang.String urlPath)
Description copied from interface: DownloadStrategy
Returns true if the DownloadStrategy is supported for the given url path.

Specified by:
matches in interface DownloadStrategy
Parameters:
urlPath - the result of HttpServletRequest.getRequestURI() converted to lowercase

serveFile

public void serveFile(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws DownloadException
Description copied from interface: DownloadStrategy
Serves the file for the given request and response.

Specified by:
serveFile in interface DownloadStrategy
Throws:
DownloadException - if there was an error during serving of the file.

setCharacterEncoding

public void setCharacterEncoding(java.lang.String characterEncoding)

setContentTypeResolver

public void setContentTypeResolver(ContentTypeResolver contentTypeResolver)

setPluginResourceLocator

public void setPluginResourceLocator(PluginResourceLocator pluginResourceLocator)


Copyright © 2010 Atlassian. All Rights Reserved.