com.atlassian.plugin.servlet
Class PluginResourceDownload
java.lang.Object
com.atlassian.plugin.servlet.PluginResourceDownload
- All Implemented Interfaces:
- DownloadStrategy
public class PluginResourceDownload
- extends 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PluginResourceDownload
public PluginResourceDownload()
PluginResourceDownload
public PluginResourceDownload(PluginResourceLocator pluginResourceLocator,
ContentTypeResolver contentTypeResolver,
String characterEncoding)
matches
public boolean matches(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(String characterEncoding)
setContentTypeResolver
public void setContentTypeResolver(ContentTypeResolver contentTypeResolver)
setPluginResourceLocator
public void setPluginResourceLocator(PluginResourceLocator pluginResourceLocator)
Copyright © 2011 Atlassian. All Rights Reserved.