Package com.saperion.ngc.servlet
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 -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()protected DocumentServicegetDocService(jakarta.servlet.http.HttpSession session) Returns an instance of theDocumentServiceby the given session.voidinit()protected voidwriteContent(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 voidwriteContent(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 voidwriteContent(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 voidwriteInputStream(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 voidwriteInputStream(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, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Constructor Details
-
AbstractStreamingServlet
public AbstractStreamingServlet()
-
-
Method Details
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
initin classjakarta.servlet.GenericServlet- Throws:
jakarta.servlet.ServletException- See Also:
-
GenericServlet.init()
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Servlet- Overrides:
destroyin classjakarta.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 requestresponse- the responsehDoc- the hdocelement- the elementfilename- the filenamecurrentRevision- current revisionforceInline- 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 requestresponse- the responsehDoc- the hdocelement- the elementfilename- the filenamecurrentRevision- 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 requestresponse- the responsehDoc- the hdocelement- the elementfilename- the filenamecurrentRevision- current revisionstart- position to start atsize- 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- TheHttpServletRequest.response- TheHttpServletResponsein- TheInputStreamthat 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- TheHttpServletRequest.response- TheHttpServletResponsein- TheInputStreamthat holds the data to write to the output stream.filename- The filename of the data.- Throws:
IOException- if an exception occurs.
-
getDocService
Returns an instance of theDocumentServiceby the given session.- Parameters:
session- The current session instance.- Returns:
- an instance of the
DocumentService.
-