D
- action definitionpublic class DownloadBinaryAction<D extends DownloadBinaryActionDefinition> extends AbstractAction<D>
Constructor and Description |
---|
DownloadBinaryAction(D definition,
JcrItemAdapter item) |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the action.
|
protected javax.jcr.Node |
getBinaryNode(javax.jcr.Node node) |
protected String |
getFileName(javax.jcr.Node binaryNode) |
protected InputStream |
getInputStream(javax.jcr.Node binaryNode) |
protected DownloadStreamResource |
getStreamResource(InputStream inputStream,
String fileName)
Returns a downloadable
DownloadStreamResource created from the supplied InputStream . |
getDefinition
@Inject public DownloadBinaryAction(D definition, JcrItemAdapter item)
public void execute() throws ActionExecutionException
Action
ActionExecutionException
- if an error occurs performing the actionprotected DownloadStreamResource getStreamResource(InputStream inputStream, String fileName)
DownloadStreamResource
created from the supplied InputStream
.DownloadStream.DEFAULT_CACHETIME
,
StreamResource
protected InputStream getInputStream(javax.jcr.Node binaryNode) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String getFileName(javax.jcr.Node binaryNode) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Node getBinaryNode(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Copyright © 2018 Magnolia International Ltd.. All rights reserved.