1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.fileupload;
18
19
20 /**
21 * <p>High level API for processing file uploads.</p>
22 *
23 * <p>This class handles multiple files per single HTML widget, sent using
24 * <code>multipart/mixed</code> encoding type, as specified by
25 * <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Use {@link
26 * #parseRequest(javax.servlet.http.HttpServletRequest)} to acquire a list
27 * of {@link org.apache.commons.fileupload.FileItem FileItems} associated
28 * with a given HTML widget.</p>
29 *
30 * <p>How the data for individual parts is stored is determined by the factory
31 * used to create them; a given part may be in memory, on disk, or somewhere
32 * else.</p>
33 *
34 * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
35 * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
36 * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
37 * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
38 * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
39 * @author Sean C. Sullivan
40 *
41 * @version $Id: FileUpload.java 479484 2006-11-27 01:06:53Z jochen $
42 */
43 public class FileUpload
44 extends FileUploadBase {
45
46
47
48
49 /**
50 * The factory to use to create new form items.
51 */
52 private FileItemFactory fileItemFactory;
53
54
55
56
57
58 /**
59 * Constructs an uninitialised instance of this class. A factory must be
60 * configured, using <code>setFileItemFactory()</code>, before attempting
61 * to parse requests.
62 *
63 * @see #FileUpload(FileItemFactory)
64 */
65 public FileUpload() {
66 super();
67 }
68
69
70 /**
71 * Constructs an instance of this class which uses the supplied factory to
72 * create <code>FileItem</code> instances.
73 *
74 * @see #FileUpload()
75 * @param fileItemFactory The factory to use for creating file items.
76 */
77 public FileUpload(FileItemFactory fileItemFactory) {
78 super();
79 this.fileItemFactory = fileItemFactory;
80 }
81
82
83
84
85
86 /**
87 * Returns the factory class used when creating file items.
88 *
89 * @return The factory class for new file items.
90 */
91 public FileItemFactory getFileItemFactory() {
92 return fileItemFactory;
93 }
94
95
96 /**
97 * Sets the factory class to use when creating file items.
98 *
99 * @param factory The factory class for new file items.
100 */
101 public void setFileItemFactory(FileItemFactory factory) {
102 this.fileItemFactory = factory;
103 }
104
105
106 }