org.mmbase.servlet
Class AttachmentServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mmbase.servlet.MMBaseServlet
              extended by org.mmbase.servlet.BridgeServlet
                  extended by org.mmbase.servlet.HandleServlet
                      extended by org.mmbase.servlet.AttachmentServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig, MMBaseStarter

public class AttachmentServlet
extends HandleServlet

Serves attachments. An attachments can be any object, as long as it has a byte[] field named 'handle'. Also the fields 'filename', 'mimetype' and 'title' can be taken into consideration by this servlet and preferably the node has also those fields.

Since:
MMBase-1.6
Version:
$Id: AttachmentServlet.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Michiel Meeuwissen
See Also:
HandleServlet, ImageServlet, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.servlet.BridgeServlet
BridgeServlet.QueryParts
 
Field Summary
 
Fields inherited from class org.mmbase.servlet.HandleServlet
legalizeFileName
 
Fields inherited from class org.mmbase.servlet.BridgeServlet
FILE_PATTERN, MESSAGE_ATTRIBUTE
 
Fields inherited from class org.mmbase.servlet.MMBaseServlet
mmbase, retryAfter
 
Constructor Summary
AttachmentServlet()
           
 
Method Summary
protected  Map<String,Integer> getAssociations()
          On default, servlets are not associated with any function.
protected  Cloud getClassCloud()
          Obtains a cloud using 'class' security.
protected  String getMimeType(Node node)
          Determines the mimetype.
 String getServletInfo()
          Returns information about this servlet.
 
Methods inherited from class org.mmbase.servlet.HandleServlet
doGet, getContentDisposition, getFileName, getSize, init, main, sendBytes, sendBytes, setCacheControl, setContent, setExpires
 
Methods inherited from class org.mmbase.servlet.BridgeServlet
desperatelyGetNode, findCloud, getAnonymousCloud, getCloud, getCloudName, getLastModified, getNode, getServedNode, readQuery, readQuery, readQueryFromRequestURI, readServletPath
 
Methods inherited from class org.mmbase.servlet.MMBaseServlet
associateMapping, checkInited, decRefCount, destroy, getBasePath, getMMBase, getRequestURL, getServletByAssociation, getServletByMapping, getServletMappings, getServletMappingsByAssociation, incRefCount, service, setInitException, setMMBase
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentServlet

public AttachmentServlet()
Method Detail

getServletInfo

public String getServletInfo()
Description copied from class: MMBaseServlet
Returns information about this servlet. Don't forget to override it.

Specified by:
getServletInfo in interface Servlet
Overrides:
getServletInfo in class MMBaseServlet

getAssociations

protected Map<String,Integer> getAssociations()
Description copied from class: MMBaseServlet
On default, servlets are not associated with any function. This function is called in the init method.

Overrides:
getAssociations in class HandleServlet
Returns:
A map of Strings (function) -> Integer (priority). Never null.

getClassCloud

protected final Cloud getClassCloud()
Description copied from class: BridgeServlet
Obtains a cloud using 'class' security. If e.g. you authorize org.mmbase.servlet.ImageServlet by class-security for read all rights, it will be used.

Overrides:
getClassCloud in class HandleServlet

getMimeType

protected String getMimeType(Node node)
Determines the mimetype. Can be overridden.

Overrides:
getMimeType in class HandleServlet


MMBase 2.0-SNAPSHOT - null