Package com.saperion.ngc.servlet
Class AbstractStreamingServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.saperion.ngc.servlet.AbstractStreamingServlet
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
SignedStreamingServlet,StreamingServlet,ViewDocumentServlet,ViewTemporaryDocumentServlet
public abstract class AbstractStreamingServlet extends javax.servlet.http.HttpServletAbstract class with common methods for streaming servlets.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractStreamingServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected DocumentServicegetDocService(javax.servlet.http.HttpSession session)Returns an instance of theDocumentServiceby the given session.voidinit()protected voidwriteContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String hDoc, int element, java.lang.String filename, boolean currentRevision)Writes the document's content to the request's output stream.protected voidwriteContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String hDoc, int element, java.lang.String filename, boolean currentRevision, boolean forceInline)Writes the document's content to the request's output stream.protected voidwriteContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String hDoc, int element, java.lang.String filename, boolean currentRevision, long start, long size)Writes the document's content to the request's output stream.protected voidwriteInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.InputStream in, java.lang.String filename)Writes the given input stream to the responses output stream.protected voidwriteInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.InputStream in, java.lang.String filename, boolean forceInline)Writes the given input stream to the responses output stream.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException- See Also:
GenericServlet.init()
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet- See Also:
GenericServlet.destroy()
-
writeContent
protected void writeContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String hDoc, int element, java.lang.String filename, boolean currentRevision, boolean forceInline) throws java.io.IOExceptionWrites 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:
java.io.IOException- Signals that an I/O exception has occurred.
-
writeContent
protected void writeContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String hDoc, int element, java.lang.String filename, boolean currentRevision) throws java.io.IOExceptionWrites 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:
java.io.IOException- Signals that an I/O exception has occurred.
-
writeContent
protected void writeContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String hDoc, int element, java.lang.String filename, boolean currentRevision, long start, long size) throws java.io.IOExceptionWrites 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:
java.io.IOException- Signals that an I/O exception has occurred.
-
writeInputStream
protected void writeInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.InputStream in, java.lang.String filename, boolean forceInline) throws java.io.IOExceptionWrites 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:
java.io.IOException- if an exception occurs.
-
writeInputStream
protected void writeInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.InputStream in, java.lang.String filename) throws java.io.IOExceptionWrites 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:
java.io.IOException- if an exception occurs.
-
getDocService
protected DocumentService getDocService(javax.servlet.http.HttpSession session)
Returns an instance of theDocumentServiceby the given session.- Parameters:
session- The current session instance.- Returns:
- an instance of the
DocumentService.
-
-