Class DownloadContentServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.alfresco.web.app.servlet.DownloadContentServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class DownloadContentServlet extends jakarta.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:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DownloadContentServlet

      public DownloadContentServlet()
  • Method Details

    • doGet

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