com.atlassian.plugin.servlet.download.plugin
Class PluggableDownloadStrategy

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

public class PluggableDownloadStrategy
extends Object
implements DownloadStrategy

A download strategy which maintains a list of DownloadStrategyModuleDescriptors and delegates to them in order.

Since:
2.2.0
See Also:
DownloadStrategyModuleDescriptor, DownloadStrategy

Constructor Summary
PluggableDownloadStrategy(PluginEventManager pluginEventManager)
           
 
Method Summary
 boolean matches(String urlPath)
          Returns true if the DownloadStrategy is supported for the given url path.
 void pluginModuleDisabled(PluginModuleDisabledEvent event)
           
 void pluginModuleEnabled(PluginModuleEnabledEvent event)
           
 void register(String key, DownloadStrategy strategy)
           
 void serveFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Serves the file for the given request and response.
 void unregister(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluggableDownloadStrategy

public PluggableDownloadStrategy(PluginEventManager pluginEventManager)
Method Detail

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.

register

public void register(String key,
                     DownloadStrategy strategy)

unregister

public void unregister(String key)

pluginModuleEnabled

public void pluginModuleEnabled(PluginModuleEnabledEvent event)

pluginModuleDisabled

public void pluginModuleDisabled(PluginModuleDisabledEvent event)


Copyright © 2015 Atlassian. All rights reserved.