KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tomcat > util > http > fileupload > FileUpload


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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
18
19 package org.apache.tomcat.util.http.fileupload;
20
21
22 /**
23  * <p>High level API for processing file uploads.</p>
24  *
25  * <p>This class handles multiple files per single HTML widget, sent using
26  * <code>multipart/mixed</code> encoding type, as specified by
27  * <a HREF="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Use {@link
28  * #parseRequest(HttpServletRequest)} to acquire a list of {@link
29  * org.apache.tomcat.util.http.fileupload.FileItem}s associated with a given HTML
30  * widget.</p>
31  *
32  * <p>How the data for individual parts is stored is determined by the factory
33  * used to create them; a given part may be in memory, on disk, or somewhere
34  * else.</p>
35  *
36  * @author <a HREF="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
37  * @author <a HREF="mailto:dlr@collab.net">Daniel Rall</a>
38  * @author <a HREF="mailto:jvanzyl@apache.org">Jason van Zyl</a>
39  * @author <a HREF="mailto:jmcnally@collab.net">John McNally</a>
40  * @author <a HREF="mailto:martinc@apache.org">Martin Cooper</a>
41  * @author Sean C. Sullivan
42  *
43  * @version $Id: FileUpload.java 467222 2006-10-24 03:17:11Z markt $
44  */

45 public class FileUpload
46     extends FileUploadBase
47  {
48
49     // ----------------------------------------------------------- Data members
50

51
52     /**
53      * The factory to use to create new form items.
54      */

55     private FileItemFactory fileItemFactory;
56
57
58     // ----------------------------------------------------------- Constructors
59

60
61     /**
62      * Constructs an instance of this class which uses the default factory to
63      * create <code>FileItem</code> instances.
64      *
65      * @see #FileUpload(FileItemFactory)
66      */

67     public FileUpload()
68     {
69         super();
70     }
71
72
73     /**
74      * Constructs an instance of this class which uses the supplied factory to
75      * create <code>FileItem</code> instances.
76      *
77      * @see #FileUpload()
78      */

79     public FileUpload(FileItemFactory fileItemFactory)
80     {
81         super();
82         this.fileItemFactory = fileItemFactory;
83     }
84
85
86     // ----------------------------------------------------- Property accessors
87

88
89     /**
90      * Returns the factory class used when creating file items.
91      *
92      * @return The factory class for new file items.
93      */

94     public FileItemFactory getFileItemFactory()
95     {
96         return fileItemFactory;
97     }
98
99
100     /**
101      * Sets the factory class to use when creating file items.
102      *
103      * @param factory The factory class for new file items.
104      */

105     public void setFileItemFactory(FileItemFactory factory)
106     {
107         this.fileItemFactory = factory;
108     }
109
110
111 }
112
Popular Tags