Class DelegatorDownloadResourceManager
java.lang.Object
com.atlassian.confluence.importexport.resource.DelegatorDownloadResourceManager
- All Implemented Interfaces:
- DownloadResourceManager,- PartialDownloadResourceManager
public class DelegatorDownloadResourceManager
extends Object
implements PartialDownloadResourceManager
Delegates to the appropriate download resource manager for resource retrievals.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetPartialResourceReader(String userName, String resourcePath, Map parameters, String requestRange) Returns aDownloadResourceReaderfor part of a downloadable resource.getResourceReader(String userName, String resourcePath, Map parameters) Returns aDownloadResourceReaderfor a downloadable resource.booleanReturns a boolean to indicate whether the current DownloadResourceManager will know how to handle the given resourcePath.voidsetDownloadResourceManagers(List<DownloadResourceManager> downloadResourceManagers) 
- 
Constructor Details- 
DelegatorDownloadResourceManagerpublic DelegatorDownloadResourceManager()
 
- 
- 
Method Details- 
matchesDescription copied from interface:DownloadResourceManagerReturns a boolean to indicate whether the current DownloadResourceManager will know how to handle the given resourcePath.- Specified by:
- matchesin interface- DownloadResourceManager
- Parameters:
- resourcePath- the relative URL of the resource including the application context path. For example, "/confluence/download/attachments/12345/temp.png".
- Returns:
- true if the manager can handle the given resource path
 
- 
getResourceReaderpublic DownloadResourceReader getResourceReader(String userName, String resourcePath, Map parameters) throws DownloadResourceNotFoundException, UnauthorizedDownloadResourceException Description copied from interface:DownloadResourceManagerReturns aDownloadResourceReaderfor a downloadable resource. Typically used by HTML/PDF export and resource content downloads.Use this method only if DownloadResourceManager.matches(String)returns true.- Specified by:
- getResourceReaderin interface- DownloadResourceManager
- Parameters:
- userName- the user who is retrieving the downloadable resource.
- resourcePath- the relative URL of the resource including the application context path. For example, "/confluence/download/attachments/12345/temp.png".
- parameters- a map of url paramaters for the resource
- Returns:
- a DownloadResourceReader to read the resource content from
- Throws:
- DownloadResourceNotFoundException- if the downloadable resource associated with the resourcePath cannot be found
- UnauthorizedDownloadResourceException- if the user requesting the downloadable resource does not have the permissions to get it
 
- 
getPartialResourceReaderpublic PartialDownloadResourceReader getPartialResourceReader(String userName, String resourcePath, Map parameters, String requestRange) throws UnauthorizedDownloadResourceException, DownloadResourceNotFoundException, RangeNotSatisfiableException Description copied from interface:PartialDownloadResourceManagerReturns aDownloadResourceReaderfor part of a downloadable resource. Currently being used by attachment downloads Use this method only ifDownloadResourceManager.matches(String)returns true.- Specified by:
- getPartialResourceReaderin interface- PartialDownloadResourceManager
- Parameters:
- userName- the user who is retrieving the downloadable resource.
- resourcePath- the relative URL of the resource including the application context path. For example, "/confluence/download/attachments/12345/temp.png".
- parameters- a map of url paramaters for the resource
- requestRange- range of the resource as defined in RFC-2616 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1
- Returns:
- a DownloadResourceReader to read the resource content from
- Throws:
- UnauthorizedDownloadResourceException- if the user requesting the downloadable resource does not have the permissions to get it
- DownloadResourceNotFoundException- if the downloadable resource associated with the resourcePath cannot be found
- RangeNotSatisfiableException- if the requested range cannot be served
 
- 
setDownloadResourceManagers
 
-