public class DownloadServiceImpl extends DefaultComponent implements DownloadService
DownloadService.ByteRange
BLOBHOLDER_0, BLOBHOLDER_PREFIX, EVENT_NAME, NXBIGBLOB, NXBIGFILE, NXBIGZIPFILE, NXDOWNLOADINFO
Constructor and Description |
---|
DownloadServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
downloadBlob(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
DocumentModel doc,
String xpath,
Blob blob,
String filename,
String reason)
Triggers a blob download.
|
void |
downloadBlob(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
DocumentModel doc,
String xpath,
Blob blob,
String filename,
String reason,
Map<String,Serializable> extendedInfos)
Triggers a blob download.
|
String |
getDownloadUrl(String repositoryName,
String docId,
String xpath,
String filename)
Gets the URL to use to download the blob at the given xpath in the given document.
|
void |
logDownload(DocumentModel doc,
String xpath,
String filename,
String reason,
Map<String,Serializable> extendedInfos)
Logs a download.
|
Blob |
resolveBlob(DocumentModel doc,
String xpath)
Finds a document's blob given an xpath or blobholder index
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, unregisterContribution, unregisterExtension
public String getDownloadUrl(String repositoryName, String docId, String xpath, String filename)
DownloadService
The URL is relative to the Nuxeo Web Application context.
Returns something like nxbigfile/reponame/docuuid/blobholder:0/foo.jpg
getDownloadUrl
in interface DownloadService
xpath
- the blob's xpath or blobholder indexpublic void downloadBlob(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DocumentModel doc, String xpath, Blob blob, String filename, String reason) throws IOException
DownloadService
downloadBlob
in interface DownloadService
doc
- the document, if availablexpath
- the blob's xpath or blobholder index, if availableblob
- the blob, if already fetchedfilename
- the filename to usereason
- the download reasonIOException
public void downloadBlob(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DocumentModel doc, String xpath, Blob blob, String filename, String reason, Map<String,Serializable> extendedInfos) throws IOException
DownloadService
downloadBlob
in interface DownloadService
doc
- the document, if availablexpath
- the blob's xpath or blobholder index, if availableblob
- the blob, if already fetchedfilename
- the filename to usereason
- the download reasonextendedInfos
- an optional map of extended informations to logIOException
public Blob resolveBlob(DocumentModel doc, String xpath)
DownloadService
resolveBlob
in interface DownloadService
doc
- the documentxpath
- the xpath or blobholder indexnull
if not foundpublic void logDownload(DocumentModel doc, String xpath, String filename, String reason, Map<String,Serializable> extendedInfos)
DownloadService
logDownload
in interface DownloadService
doc
- the doc for which this download occurs, if availablexpath
- the blob's xpath or blobholder index, if availablefilename
- the filenamereason
- the download reasonextendedInfos
- an optional map of extended informations to logCopyright © 2015 Nuxeo SA. All rights reserved.