Class DownloadContentServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class DownloadContentServlet
    extends javax.servlet.http.HttpServlet
    Servlet responsible for streaming node content from the repo directly to the response stream. The appropriate mimetype is calculated based on filename extension.

    The URL to the servlet should be generated thus:

    /alfresco/download/attach/workspace/SpacesStore/0000-0000-0000-0000/myfile.pdf
    or
    /alfresco/download/direct/workspace/SpacesStore/0000-0000-0000-0000/myfile.pdf

    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.

    Since ACS 6.X, this Servlet redirects to GET /nodes/{nodeId}/content V1 REST API.

    Author:
    Kevin Roast, gavinc
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doGet​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)  
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
    • Constructor Detail

      • DownloadContentServlet

        public DownloadContentServlet()
    • Method Detail

      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse res)
                      throws IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        IOException
        See Also:
        HttpServlet.doGet(HttpServletRequest, HttpServletResponse)