com.opensymphony.webwork.interceptor
Class FileUploadInterceptor

java.lang.Object
  extended bycom.opensymphony.webwork.interceptor.FileUploadInterceptor
All Implemented Interfaces:
com.opensymphony.xwork.interceptor.Interceptor

public class FileUploadInterceptor
extends Object
implements com.opensymphony.xwork.interceptor.Interceptor

Interceptor that is based off of MultiPartRequestWrapper. It adds the following parameters, where [File Name] is the name given to the file uploaded by the HTML form:

You can get access to these files by merely providing setters in your action that correspond to any of the three patterns above, such as setDocument(File document), setDocumentContentType(String contentType), etc.


Field Summary
protected  String allowedTypes
           
protected  String disallowedTypes
           
protected static org.apache.commons.logging.Log log
           
protected  Long maximumSize
           
 
Constructor Summary
FileUploadInterceptor()
           
 
Method Summary
 void destroy()
           
 void init()
           
 String intercept(com.opensymphony.xwork.ActionInvocation invocation)
           
 void setAllowedTypes(String allowedTypes)
           
 void setDisallowedTypes(String disallowedTypes)
           
 void setMaximumSize(Long maximumSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

maximumSize

protected Long maximumSize

allowedTypes

protected String allowedTypes

disallowedTypes

protected String disallowedTypes
Constructor Detail

FileUploadInterceptor

public FileUploadInterceptor()
Method Detail

setAllowedTypes

public void setAllowedTypes(String allowedTypes)

setDisallowedTypes

public void setDisallowedTypes(String disallowedTypes)

setMaximumSize

public void setMaximumSize(Long maximumSize)

destroy

public void destroy()
Specified by:
destroy in interface com.opensymphony.xwork.interceptor.Interceptor

init

public void init()
Specified by:
init in interface com.opensymphony.xwork.interceptor.Interceptor

intercept

public String intercept(com.opensymphony.xwork.ActionInvocation invocation)
                 throws Exception
Specified by:
intercept in interface com.opensymphony.xwork.interceptor.Interceptor
Throws:
Exception

WebWork Project Page