Java Doc for MultiPartRequestWrapper.java in  » Web-Framework » struts-2.0.11 » org » apache » struts2 » dispatcher » multipart » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » struts 2.0.11 » org.apache.struts2.dispatcher.multipart 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.struts2.dispatcher.StrutsRequestWrapper
   org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

MultiPartRequestWrapper
public class MultiPartRequestWrapper extends StrutsRequestWrapper (Code)
Parse a multipart request and provide a wrapper around the request. The parsing implementation used depends on the struts.multipart.parser setting. It should be set to a class which extends org.apache.struts2.dispatcher.multipart.MultiPartRequest .

The struts.multipart.parser property should be set to jakarta for the Jakarta implementation, pell for the Pell implementation and cos for the Jason Hunter implementation.

The files are uploaded when the object is instantiated. If there are any errors they are logged using MultiPartRequestWrapper.addError(String) . An action handling a multipart form should first check MultiPartRequestWrapper.hasErrors() before doing any other processing.

An alternate implementation, PellMultiPartRequest, is provided as a plugin.



Field Summary
 Collection<String>errors
    
final protected static  Loglog
    
 MultiPartRequestmulti
    

Constructor Summary
public  MultiPartRequestWrapper(MultiPartRequest multiPartRequest, HttpServletRequest request, String saveDir)
     Process file downloads and log any errors.

Method Summary
protected  voidaddError(String anErrorMessage)
     Adds an error message.
public  String[]getContentTypes(String name)
     Get an array of content encoding for the specified input field name or null if no content type was specified.
public  Collection<String>getErrors()
     Returns a collection of any errors generated when parsing the multipart request.
public  String[]getFileNames(String fieldName)
     Get a String array of the file names for uploaded files
Parameters:
  fieldName - Field to check for file names.
public  Enumeration<String>getFileParameterNames()
    
public  String[]getFileSystemNames(String fieldName)
     Get the filename(s) of the file(s) uploaded for the given input field name.
public  File[]getFiles(String fieldName)
     Get a java.io.File[] for the given input field name.
public  StringgetParameter(String name)
    
public  MapgetParameterMap()
    
public  EnumerationgetParameterNames()
    
public  String[]getParameterValues(String name)
    
public  booleanhasErrors()
     Returns true if any errors occured when parsing the HTTP multipart request, false otherwise.
protected  EnumerationmergeParams(Enumeration params1, Enumeration params2)
     Merges 2 enumeration of parameters as one.
Parameters:
  params1 - the first enumeration.
Parameters:
  params2 - the second enumeration.

Field Detail
errors
Collection<String> errors(Code)



log
final protected static Log log(Code)



multi
MultiPartRequest multi(Code)




Constructor Detail
MultiPartRequestWrapper
public MultiPartRequestWrapper(MultiPartRequest multiPartRequest, HttpServletRequest request, String saveDir)(Code)
Process file downloads and log any errors.
Parameters:
  request - Our HttpServletRequest object
Parameters:
  saveDir - Target directory for any files that we save
Parameters:
  multiPartRequest - Our MultiPartRequest object




Method Detail
addError
protected void addError(String anErrorMessage)(Code)
Adds an error message.
Parameters:
  anErrorMessage - the error message to report.



getContentTypes
public String[] getContentTypes(String name)(Code)
Get an array of content encoding for the specified input field name or null if no content type was specified.
Parameters:
  name - input field name an array of content encoding for the specified input field name



getErrors
public Collection<String> getErrors()(Code)
Returns a collection of any errors generated when parsing the multipart request. the error Collection.



getFileNames
public String[] getFileNames(String fieldName)(Code)
Get a String array of the file names for uploaded files
Parameters:
  fieldName - Field to check for file names. a String[] of file names for uploaded files



getFileParameterNames
public Enumeration<String> getFileParameterNames()(Code)
Get an enumeration of the parameter names for uploaded files enumeration of parameter names for uploaded files



getFileSystemNames
public String[] getFileSystemNames(String fieldName)(Code)
Get the filename(s) of the file(s) uploaded for the given input field name. Returns null if the file is not found.
Parameters:
  fieldName - input field name the filename(s) of the file(s) uploaded for the given input field name ornull if name not found.



getFiles
public File[] getFiles(String fieldName)(Code)
Get a java.io.File[] for the given input field name.
Parameters:
  fieldName - input field name a File[] object for files associated with the specified input field name



getParameter
public String getParameter(String name)(Code)

See Also:   javax.servlet.http.HttpServletRequest.getParameter(String)



getParameterMap
public Map getParameterMap()(Code)

See Also:   javax.servlet.http.HttpServletRequest.getParameterMap



getParameterNames
public Enumeration getParameterNames()(Code)

See Also:   javax.servlet.http.HttpServletRequest.getParameterNames



getParameterValues
public String[] getParameterValues(String name)(Code)

See Also:   javax.servlet.http.HttpServletRequest.getParameterValues(String)



hasErrors
public boolean hasErrors()(Code)
Returns true if any errors occured when parsing the HTTP multipart request, false otherwise. true if any errors occured when parsing the HTTP multipart request, false otherwise.



mergeParams
protected Enumeration mergeParams(Enumeration params1, Enumeration params2)(Code)
Merges 2 enumeration of parameters as one.
Parameters:
  params1 - the first enumeration.
Parameters:
  params2 - the second enumeration. a single Enumeration of all elements from both Enumerations.



Methods inherited from org.apache.struts2.dispatcher.StrutsRequestWrapper
public Object getAttribute(String s)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.