01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.commons.fileupload;
18:
19: /**
20: * <p>High level API for processing file uploads.</p>
21: *
22: * <p>This class handles multiple files per single HTML widget, sent using
23: * <code>multipart/mixed</code> encoding type, as specified by
24: * <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Use {@link
25: * #parseRequest(javax.servlet.http.HttpServletRequest)} to acquire a list
26: * of {@link org.apache.commons.fileupload.FileItem FileItems} associated
27: * with a given HTML widget.</p>
28: *
29: * <p>How the data for individual parts is stored is determined by the factory
30: * used to create them; a given part may be in memory, on disk, or somewhere
31: * else.</p>
32: *
33: * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
34: * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
35: * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
36: * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
37: * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
38: * @author Sean C. Sullivan
39: *
40: * @version $Id: FileUpload.java 479484 2006-11-27 01:06:53Z jochen $
41: */
42: public class FileUpload extends FileUploadBase {
43:
44: // ----------------------------------------------------------- Data members
45:
46: /**
47: * The factory to use to create new form items.
48: */
49: private FileItemFactory fileItemFactory;
50:
51: // ----------------------------------------------------------- Constructors
52:
53: /**
54: * Constructs an uninitialised instance of this class. A factory must be
55: * configured, using <code>setFileItemFactory()</code>, before attempting
56: * to parse requests.
57: *
58: * @see #FileUpload(FileItemFactory)
59: */
60: public FileUpload() {
61: super ();
62: }
63:
64: /**
65: * Constructs an instance of this class which uses the supplied factory to
66: * create <code>FileItem</code> instances.
67: *
68: * @see #FileUpload()
69: * @param fileItemFactory The factory to use for creating file items.
70: */
71: public FileUpload(FileItemFactory fileItemFactory) {
72: super ();
73: this .fileItemFactory = fileItemFactory;
74: }
75:
76: // ----------------------------------------------------- Property accessors
77:
78: /**
79: * Returns the factory class used when creating file items.
80: *
81: * @return The factory class for new file items.
82: */
83: public FileItemFactory getFileItemFactory() {
84: return fileItemFactory;
85: }
86:
87: /**
88: * Sets the factory class to use when creating file items.
89: *
90: * @param factory The factory class for new file items.
91: */
92: public void setFileItemFactory(FileItemFactory factory) {
93: this.fileItemFactory = factory;
94: }
95:
96: }
|