org.apache.james.mailet.standard.mailets
Class RecoverAttachment

java.lang.Object
  extended by org.apache.mailet.base.GenericMailet
      extended by org.apache.james.mailet.standard.mailets.RecoverAttachment
All Implemented Interfaces:
Mailet, MailetConfig

public class RecoverAttachment
extends GenericMailet

This mailet takes an attachment stored in an attribute and attach it back to the message

This may be used to place back attachment stripped by StripAttachment and stored in the attribute org.apache.james.mailet.standard.mailets.StripAttachment.saved

   <mailet match="All" class="RecoverAttachment" >
     <attribute>my.attribute.name</attribute>
   </mailet >
 


Field Summary
static String ATTRIBUTE_PARAMETER_NAME
           
 
Constructor Summary
RecoverAttachment()
           
 
Method Summary
 String getMailetInfo()
          returns a String describing this mailet.
 void init()
          Checks if the mandatory parameters are present
 void service(Mail mail)
          Service the mail: check for the attribute and attach the attachment to the mail.
 
Methods inherited from class org.apache.mailet.base.GenericMailet
arrayToString, checkInitParameters, destroy, getInitParameter, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_PARAMETER_NAME

public static final String ATTRIBUTE_PARAMETER_NAME
See Also:
Constant Field Values
Constructor Detail

RecoverAttachment

public RecoverAttachment()
Method Detail

init

public void init()
          throws MailetException
Checks if the mandatory parameters are present

Overrides:
init in class GenericMailet
Throws:
MailetException

service

public void service(Mail mail)
             throws MailetException
Service the mail: check for the attribute and attach the attachment to the mail.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - The mail to service
Throws:
MailetException - Thrown when an error situation is encountered.

getMailetInfo

public String getMailetInfo()
returns a String describing this mailet.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
A desciption of this mailet


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.