public class DownloadAction extends XWikiAction
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_NAME
The identifier of the download action.
|
static String |
ATTACHMENT
The identifier of the attachment disposition.
|
static String |
BLACKLIST_PROPERTY
Key of the blacklist in xwiki.properties.
|
static String |
FORCE_DOWNLOAD_PROPERTY
Key of the forceDownload list in xwiki.properties.
|
static List<String> |
MIMETYPE_WHITELIST
List of authorized attachment mimetypes.
|
static String |
WHITELIST_PROPERTY
Key of the whitelist in xwiki.properties.
|
ACTION_PROGRESS, handleRedirectObject, waitForXWikiInitialization
Constructor and Description |
---|
DownloadAction()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
render(XWikiContext context) |
protected void |
sendContent(XWikiAttachment attachment,
XWikiRequest request,
XWikiResponse response,
XWikiContext context)
Send the attachment content in the response.
|
action, answerJSON, cleanupComponents, csrfTokenCheck, csrfTokenCheck, execute, execute, getContextualAuthorizationManager, getCurrentMixedDocumentReferenceResolver, getCurrentScriptContext, getEntityNameValidationConfiguration, getEntityNameValidationManager, getLocalization, getLocalSerializer, getProgress, getRealPath, getTranslatedDocument, handleRedirectObject, handleRevision, initializeContainerComponent, initializeXWikiContext, isEntityReferenceNameValid, localizePlainOrKey, readFromTemplate, resolveTemplate, sendGlobalRedirect, sendRedirect, setContentLength, writeAjaxErrorResponse
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
public static final String ACTION_NAME
public static final String ATTACHMENT
public static final List<String> MIMETYPE_WHITELIST
public static final String WHITELIST_PROPERTY
public static final String BLACKLIST_PROPERTY
@Unstable public static final String FORCE_DOWNLOAD_PROPERTY
public String render(XWikiContext context) throws XWikiException
render
in class XWikiAction
XWikiException
protected void sendContent(XWikiAttachment attachment, XWikiRequest request, XWikiResponse response, XWikiContext context) throws XWikiException
attachment
- the attachment to get content fromrequest
- the current client requestresponse
- the response to write to.context
- the XWikiContext just in case it is needed to load the attachment contentXWikiException
- if something goes wrongCopyright © 2004–2021 XWiki. All rights reserved.