java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.RuntimeCollective.content.servlet.FileServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class FileServlet
- extends javax.servlet.http.HttpServlet
Serves Files, based on the request URL.
The URL should be of the form:
http://www.myServer.com/url-pattern/1234.pdf
where
url-pattern is mapped in
web.xml,
1234 is the File id, and
.pdf is the file type of the File.
The (possibly) returned file will be:
contentFilesDataDir/1234.pdf
where
contentFileDir is defined in
web.xml.
Note: the "image/vnd.rn-realflash" mime type is replaced with "application/x-shockwave-flash".
- Version:
- $Id: FileServlet.java,v 1.8 2003/10/13 15:42:42 fabrice Exp $
| Fields inherited from class javax.servlet.http.HttpServlet |
|
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileServlet
public FileServlet()
doGet
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
- Write the requested File to the connection, after permission checks
writeBlankResponse
private void writeBlankResponse(javax.servlet.ServletOutputStream outStream)
throws java.io.IOException
- Write an empty String to the response
allowDownload
public boolean allowDownload(javax.servlet.http.HttpServletRequest request,
com.RuntimeCollective.content.bean.File file)
- Check the permissions of a given request on a given File.
This returns true in all cases.
FIXME: implement some security for the CMS here; sharedfs
has security in a subclass.