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.wicket.util.upload;
18:
19: /**
20: * <p>
21: * High level API for processing file uploads.
22: * </p>
23: *
24: * <p>
25: * This class handles multiple files per single HTML widget, sent using
26: * <code>multipart/mixed</code> encoding type, as specified by <a
27: * href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>.
28: * </p>
29: *
30: * <p>
31: * How the data for individual parts is stored is determined by the factory used
32: * to create them; a given part may be in memory, on disk, or somewhere else.
33: * </p>
34: *
35: * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
36: * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
37: * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
38: * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
39: * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
40: * @author Sean C. Sullivan
41: */
42: public class FileUpload extends FileUploadBase {
43:
44: /**
45: * The factory to use to create new form items.
46: */
47: private FileItemFactory fileItemFactory;
48:
49: /**
50: * Constructs an uninitialised instance of this class. A factory must be
51: * configured, using <code>setFileItemFactory()</code>, before attempting
52: * to parse requests.
53: *
54: * @see #FileUpload(FileItemFactory)
55: */
56: public FileUpload() {
57: super ();
58: }
59:
60: /**
61: * Constructs an instance of this class which uses the supplied factory to
62: * create <code>FileItem</code> instances.
63: *
64: * @param fileItemFactory
65: *
66: * @see #FileUpload()
67: */
68: public FileUpload(FileItemFactory fileItemFactory) {
69: super ();
70: this .fileItemFactory = fileItemFactory;
71: }
72:
73: /**
74: * Returns the factory class used when creating file items.
75: *
76: * @return The factory class for new file items.
77: */
78: public FileItemFactory getFileItemFactory() {
79: return fileItemFactory;
80: }
81:
82: /**
83: * Sets the factory class to use when creating file items.
84: *
85: * @param factory
86: * The factory class for new file items.
87: */
88: public void setFileItemFactory(FileItemFactory factory) {
89: this.fileItemFactory = factory;
90: }
91: }
|