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