public class ExportDownloadResourceManager extends Object implements WritableDownloadResourceManager
WritableDownloadResourceManager
that stores and reads macro output from a temporary location.Constructor and Description |
---|
ExportDownloadResourceManager(BootstrapManager bootstrapManager,
GateKeeper gateKeeper) |
Modifier and Type | Method and Description |
---|---|
DownloadResourceReader |
getResourceReader(String userName,
String resourcePath,
Map parameters)
Returns a
FileDownloadResourceReader for reading the stored output of the previous execution of a macro. |
DownloadResourceWriter |
getResourceWriter(String userName,
String prefix,
String suffix)
Returns a
FileDownloadResourceWriter for storing output of a macro in a temporary location. |
boolean |
matches(String resourcePath)
Returns a boolean to indicate whether the current DownloadResourceManager will know how to handle the
given resourcePath.
|
public ExportDownloadResourceManager(BootstrapManager bootstrapManager, GateKeeper gateKeeper)
public boolean matches(String resourcePath)
DownloadResourceManager
matches
in interface DownloadResourceManager
resourcePath
- the relative URL of the resource including the application context path. For example,
"/confluence/download/attachments/12345/temp.png".public DownloadResourceReader getResourceReader(String userName, String resourcePath, Map parameters) throws UnauthorizedDownloadResourceException, DownloadResourceNotFoundException
FileDownloadResourceReader
for reading the stored output of the previous execution of a macro.
Typically used by HTML and PDF export, macro content downloads.getResourceReader
in interface DownloadResourceManager
userName
- the user who is viewing the macro output. Must be the same as the user who created the macro
output with getResourceWriter(String, String, String)
, or an UnauthorizedDownloadResourceException
will be thrown.resourcePath
- the relative URL of the resource including the application context path. For example,
"/confluence/download/temp/chart1756.png". It must be the same path from the DownloadResourceWriter
.parameters
- a map of url paramaters for the resourceUnauthorizedDownloadResourceException
- if the user requesting the macro output is different to the user
who created itDownloadResourceNotFoundException
- if a stored macro output associated with this resource path cannot be
foundpublic DownloadResourceWriter getResourceWriter(String userName, String prefix, String suffix)
FileDownloadResourceWriter
for storing output of a macro in a temporary location.
This should be typically called by macros that generate output such as images and would like their
output to be exported correctly.getResourceWriter
in interface WritableDownloadResourceManager
userName
- the user who is creating the macro output.prefix
- the prefix of the macro output's namesuffix
- the suffix of the macro outputCopyright © 2003–2020 Atlassian. All rights reserved.