public class GuestDownloadContentServlet extends BaseDownloadContentServlet
The URL to the servlet should be generated thus:
/alfresco/guestDownload/attach/workspace/SpacesStore/0000-0000-0000-0000/myfile.pdfor
/alfresco/guestDownload/direct/workspace/SpacesStore/0000-0000-0000-0000/myfile.pdfor
/alfresco/guestDownload/[direct|attach]?path=/Company%20Home/MyFolder/myfile.pdfThe protocol, followed by either the store and Id (NodeRef) or instead specify a name based encoded Path to the content, note that the filename element is used for mimetype lookup and as the returning filename for the response stream.
The 'attach' or 'direct' element is used to indicate whether to display the stream directly in the browser or download it as a file attachment.
By default, the download assumes that the content is on the
content property
.
To retrieve the content of a specific model property, use a 'property' arg, providing the workspace,
node ID AND the qualified name of the property.
This servlet only accesses content available to the guest user. If the guest user does not have access to the requested a 403 Forbidden response is returned to the caller.
This servlet does not effect the current session, therefore if guest access is required to a resource this servlet can be used without logging out the current user.
Modifier and Type | Class and Description |
---|---|
class |
GuestDownloadContentServlet.DownloadContentWork
Class to wrap the call to processDownloadRequest.
|
BaseServlet.PathRefInfo
ARG_PATH, ARG_PROPERTY, MIMETYPE_OCTET_STREAM, MSG_ERROR_CONTENT_MISSING, MSG_ERROR_NOT_FOUND, URL_ATTACH, URL_ATTACH_LONG, URL_DIRECT, URL_DIRECT_LONG
FACES_SERVLET, KEY_ROOT_PATH, KEY_STORE
Constructor and Description |
---|
GuestDownloadContentServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
doGet(HttpServletRequest req,
HttpServletResponse res) |
static String |
generateBrowserURL(org.alfresco.service.cmr.repository.NodeRef ref,
String name)
Helper to generate a URL to a content node for downloading content from the server.
|
static String |
generateDownloadURL(org.alfresco.service.cmr.repository.NodeRef ref,
String name)
Helper to generate a URL to a content node for downloading content from the server.
|
protected org.apache.commons.logging.Log |
getLogger()
Gets the logger to use for this request.
|
generateUrl, processDownloadRequest
checkAccess, getServiceRegistry, redirectToLoginPage, redirectToLoginPage, resolveNamePath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, servletAuthenticate, servletAuthenticate, setNoCacheHeaders, validRedirectJSP
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
protected org.apache.commons.logging.Log getLogger()
BaseDownloadContentServlet
This will show all debug entries from this class as though they came from the subclass.
getLogger
in class BaseDownloadContentServlet
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
doGet
in class HttpServlet
ServletException
IOException
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public static final String generateDownloadURL(org.alfresco.service.cmr.repository.NodeRef ref, String name)
ref
- NodeRef of the content node to generate URL for (cannot be null)name
- File name to return in the URL (cannot be null)public static final String generateBrowserURL(org.alfresco.service.cmr.repository.NodeRef ref, String name)
ref
- NodeRef of the content node to generate URL for (cannot be null)name
- File name to return in the URL (cannot be null)Copyright © 2005–2017 Alfresco Software. All rights reserved.