Java Doc for CommonsFileUploadSupport.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » multipart » commons » 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 » J2EE » spring framework 2.0.6 » org.springframework.web.multipart.commons 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.web.multipart.commons.CommonsFileUploadSupport

All known Subclasses:   org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver,  org.springframework.web.multipart.commons.CommonsMultipartResolver,
CommonsFileUploadSupport
abstract public class CommonsFileUploadSupport (Code)
Base class for multipart resolvers that use Jakarta Commons FileUpload 1.1 or higher.

Provides common configuration properties and parsing functionality for multipart requests, using a Map of Spring CommonsMultipartFile instances as representation of uploaded files and a String-based parameter Map as representation of uploaded form fields.

Subclasses implement concrete resolution strategies for Servlet or Portlet environments: see CommonsMultipartResolver and CommonsPortletMultipartResolver, respectively. This base class is not tied to either of those APIs, factoring out common functionality.
author:
   Juergen Hoeller
since:
   2.0
See Also:   CommonsMultipartFile
See Also:   CommonsMultipartResolver
See Also:   org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver


Inner Class :protected static class MultipartParsingResult

Field Summary
final protected  Loglogger
    

Constructor Summary
public  CommonsFileUploadSupport()
     Instantiate a new CommonsFileUploadSupport with its corresponding FileItemFactory and FileUpload instances.

Method Summary
protected  voidcleanupFileItems(Collection multipartFiles)
     Cleanup the Spring MultipartFiles created during multipart parsing, potentially holding temporary data on disk.
protected  StringgetDefaultEncoding()
    
public  DiskFileItemFactorygetFileItemFactory()
     Return the underlying org.apache.commons.fileupload.disk.DiskFileItemFactory instance.
public  FileUploadgetFileUpload()
     Return the underlying org.apache.commons.fileupload.FileUpload instance.
protected  booleanisUploadTempDirSpecified()
    
protected  DiskFileItemFactorynewFileItemFactory()
     Factory method for a Commons DiskFileItemFactory instance.

Default implementation returns a standard DiskFileItemFactory. Can be overridden to use a custom subclass, e.g.

abstract protected  FileUploadnewFileUpload(FileItemFactory fileItemFactory)
     Factory method for a Commons FileUpload instance.
protected  MultipartParsingResultparseFileItems(List fileItems, String encoding)
     Parse the given List of Commons FileItems into a Spring MultipartParsingResult, containing Spring MultipartFile instances and a Map of multipart parameter.
protected  FileUploadprepareFileUpload(String encoding)
     Determine an appropriate FileUpload instance for the given encoding.
public  voidsetDefaultEncoding(String defaultEncoding)
     Set the default character encoding to use for parsing requests, to be applied to headers of individual parts and to form fields. Default is ISO-8859-1, according to the Servlet spec.

If the request specifies a character encoding itself, the request encoding will override this setting.

public  voidsetMaxInMemorySize(int maxInMemorySize)
     Set the maximum allowed size (in bytes) before uploads are written to disk. Uploaded files will still be received past this amount, but they will not be stored in memory.
public  voidsetMaxUploadSize(long maxUploadSize)
     Set the maximum allowed size (in bytes) before uploads are refused.
public  voidsetUploadTempDir(Resource uploadTempDir)
     Set the temporary directory where uploaded files get stored.

Field Detail
logger
final protected Log logger(Code)




Constructor Detail
CommonsFileUploadSupport
public CommonsFileUploadSupport()(Code)
Instantiate a new CommonsFileUploadSupport with its corresponding FileItemFactory and FileUpload instances.
See Also:   CommonsFileUploadSupport.newFileItemFactory
See Also:   CommonsFileUploadSupport.newFileUpload




Method Detail
cleanupFileItems
protected void cleanupFileItems(Collection multipartFiles)(Code)
Cleanup the Spring MultipartFiles created during multipart parsing, potentially holding temporary data on disk.

Deletes the underlying Commons FileItem instances.
Parameters:
  multipartFiles - Collection of MultipartFile instances
See Also:   org.apache.commons.fileupload.FileItem.delete




getDefaultEncoding
protected String getDefaultEncoding()(Code)



getFileItemFactory
public DiskFileItemFactory getFileItemFactory()(Code)
Return the underlying org.apache.commons.fileupload.disk.DiskFileItemFactory instance. There is hardly any need to access this. the underlying DiskFileItemFactory instance



getFileUpload
public FileUpload getFileUpload()(Code)
Return the underlying org.apache.commons.fileupload.FileUpload instance. There is hardly any need to access this. the underlying FileUpload instance



isUploadTempDirSpecified
protected boolean isUploadTempDirSpecified()(Code)



newFileItemFactory
protected DiskFileItemFactory newFileItemFactory()(Code)
Factory method for a Commons DiskFileItemFactory instance.

Default implementation returns a standard DiskFileItemFactory. Can be overridden to use a custom subclass, e.g. for testing purposes. the new DiskFileItemFactory instance




newFileUpload
abstract protected FileUpload newFileUpload(FileItemFactory fileItemFactory)(Code)
Factory method for a Commons FileUpload instance.

To be implemented by subclasses.
Parameters:
  fileItemFactory - the Commons FileItemFactory to build upon the Commons FileUpload instance




parseFileItems
protected MultipartParsingResult parseFileItems(List fileItems, String encoding)(Code)
Parse the given List of Commons FileItems into a Spring MultipartParsingResult, containing Spring MultipartFile instances and a Map of multipart parameter.
Parameters:
  fileItems - the Commons FileIterms to parse
Parameters:
  encoding - the encoding to use for form fields the Spring MultipartParsingResult
See Also:   CommonsMultipartFile.CommonsMultipartFile(org.apache.commons.fileupload.FileItem)



prepareFileUpload
protected FileUpload prepareFileUpload(String encoding)(Code)
Determine an appropriate FileUpload instance for the given encoding.

Default implementation returns the shared FileUpload instance if the encoding matches, else creates a new FileUpload instance with the same configuration other than the desired encoding.
Parameters:
  encoding - the character encoding to use an appropriate FileUpload instance.




setDefaultEncoding
public void setDefaultEncoding(String defaultEncoding)(Code)
Set the default character encoding to use for parsing requests, to be applied to headers of individual parts and to form fields. Default is ISO-8859-1, according to the Servlet spec.

If the request specifies a character encoding itself, the request encoding will override this setting. This also allows for generically overriding the character encoding in a filter that invokes the ServletRequest.setCharacterEncoding method.
Parameters:
  defaultEncoding - the character encoding to use
See Also:   javax.servlet.ServletRequest.getCharacterEncoding
See Also:   javax.servlet.ServletRequest.setCharacterEncoding
See Also:   WebUtils.DEFAULT_CHARACTER_ENCODING
See Also:   org.apache.commons.fileupload.FileUploadBase.setHeaderEncoding




setMaxInMemorySize
public void setMaxInMemorySize(int maxInMemorySize)(Code)
Set the maximum allowed size (in bytes) before uploads are written to disk. Uploaded files will still be received past this amount, but they will not be stored in memory. Default is 10240, according to Commons FileUpload.
Parameters:
  maxInMemorySize - the maximum in memory size allowed
See Also:   org.apache.commons.fileupload.disk.DiskFileItemFactory.setSizeThreshold



setMaxUploadSize
public void setMaxUploadSize(long maxUploadSize)(Code)
Set the maximum allowed size (in bytes) before uploads are refused. -1 indicates no limit (the default).
Parameters:
  maxUploadSize - the maximum upload size allowed
See Also:   org.apache.commons.fileupload.FileUploadBase.setSizeMax



setUploadTempDir
public void setUploadTempDir(Resource uploadTempDir) throws IOException(Code)
Set the temporary directory where uploaded files get stored. Default is the servlet container's temporary directory for the web application.
See Also:   org.springframework.web.util.WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.