com.knowgate.http
Class HttpBinaryServlet

java.lang.Object
  extended by HttpServlet
      extended by com.knowgate.http.HttpBinaryServlet

public class HttpBinaryServlet
extends HttpServlet

Send Disk Binary File To HttpServletResponse OutputStream


Constructor Summary
HttpBinaryServlet()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
          Send disk binary file held in a Product to HttpServletResponse OutputStream
 void init()
          Initialize Servlet Parameters Take Database Driver, Conenction URL and User from /WEB-INF/web.xml.
static long pipe(java.io.InputStream in, java.io.OutputStream out, int chunkSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpBinaryServlet

public HttpBinaryServlet()
Method Detail

pipe

public static long pipe(java.io.InputStream in,
                        java.io.OutputStream out,
                        int chunkSize)
                 throws java.io.IOException
Throws:
java.io.IOException

init

public void init()
          throws ServletException

Initialize Servlet Parameters

Take Database Driver, Conenction URL and User from /WEB-INF/web.xml.
If any parameter is not found then look it up at hipergate.cnf Properties file using Environment singleton.

Throws:
ServletException
UnavailableException - If jdbcDriverClassName parameter is not found and driver property at hipergate.cnf is not found or if jdbcURL parameter is not found and dburl property at hipergate.cnf is not found.
See Also:
Environment

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws java.io.IOException,
                  java.io.FileNotFoundException,
                  ServletException

Send disk binary file held in a Product to HttpServletResponse OutputStream

Parameters:
id_user - Requester User GUID.
id_product - GUID of Requested Product.
id_location - GUID of Requested ProductLocation.
id_category - (Optional) GUID from Category that contains the Product to serve. If a Category is provided then the User permissions over that Category are checked before serving the file.
Throws:
java.io.IOException
java.io.FileNotFoundException
ServletException
See Also:
ACLUser, Product, Category