Class AbstractStreamingServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.saperion.ngc.servlet.AbstractStreamingServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable
Direct Known Subclasses:
SignedStreamingServlet, StreamingServlet, ViewDocumentServlet, ViewTemporaryDocumentServlet

public abstract class AbstractStreamingServlet extends jakarta.servlet.http.HttpServlet
Abstract class with common methods for streaming servlets.
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
    void
    protected DocumentService
    getDocService(jakarta.servlet.http.HttpSession session)
    Returns an instance of the DocumentService by the given session.
    void
    protected void
    writeContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String hDoc, int element, String filename, boolean currentRevision)
    Writes the document's content to the request's output stream.
    protected void
    writeContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String hDoc, int element, String filename, boolean currentRevision, boolean forceInline)
    Writes the document's content to the request's output stream.
    protected void
    writeContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String hDoc, int element, String filename, boolean currentRevision, long start, long size)
    Writes the document's content to the request's output stream.
    protected void
    writeInputStream(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream in, String filename)
    Writes the given input stream to the responses output stream.
    protected void
    writeInputStream(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream in, String filename, boolean forceInline)
    Writes the given input stream to the responses output stream.

    Methods inherited from class jakarta.servlet.http.HttpServlet

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

    Methods inherited from class jakarta.servlet.GenericServlet

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

    Methods inherited from class java.lang.Object

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

    • AbstractStreamingServlet

      public AbstractStreamingServlet()
  • Method Details

    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
      See Also:
      • GenericServlet.init()
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Servlet
      Overrides:
      destroy in class jakarta.servlet.GenericServlet
      See Also:
      • GenericServlet.destroy()
    • writeContent

      protected void writeContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String hDoc, int element, String filename, boolean currentRevision, boolean forceInline) throws IOException
      Writes the document's content to the request's output stream.
      Parameters:
      request - the request
      response - the response
      hDoc - the hdoc
      element - the element
      filename - the filename
      currentRevision - current revision
      forceInline - if true, the content-disposition header is always set to 'inline'.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • writeContent

      protected void writeContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String hDoc, int element, String filename, boolean currentRevision) throws IOException
      Writes the document's content to the request's output stream.
      Parameters:
      request - the request
      response - the response
      hDoc - the hdoc
      element - the element
      filename - the filename
      currentRevision - current revision
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • writeContent

      protected void writeContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String hDoc, int element, String filename, boolean currentRevision, long start, long size) throws IOException
      Writes the document's content to the request's output stream.
      Parameters:
      request - the request
      response - the response
      hDoc - the hdoc
      element - the element
      filename - the filename
      currentRevision - current revision
      start - position to start at
      size - amount of data to write
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • writeInputStream

      protected void writeInputStream(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream in, String filename, boolean forceInline) throws IOException
      Writes the given input stream to the responses output stream.
      Parameters:
      request - The HttpServletRequest.
      response - The HttpServletResponse
      in - The InputStream that holds the data to write to the output stream.
      filename - The filename of the data.
      forceInline - if true, the content-disposition header is always set to 'inline'.
      Throws:
      IOException - if an exception occurs.
    • writeInputStream

      protected void writeInputStream(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, InputStream in, String filename) throws IOException
      Writes the given input stream to the responses output stream.
      Parameters:
      request - The HttpServletRequest.
      response - The HttpServletResponse
      in - The InputStream that holds the data to write to the output stream.
      filename - The filename of the data.
      Throws:
      IOException - if an exception occurs.
    • getDocService

      protected DocumentService getDocService(jakarta.servlet.http.HttpSession session)
      Returns an instance of the DocumentService by the given session.
      Parameters:
      session - The current session instance.
      Returns:
      an instance of the DocumentService.