01: /*
02: * Copyright 2001-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package net.myvietnam.mvncore.web.fileupload;
17:
18: /**
19: * <p>A factory interface for creating {@link FileItem} instances. Factories
20: * can provide their own custom configuration, over and above that provided
21: * by the default file upload implementation.</p>
22: *
23: * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
24: *
25: * @version $Id: FileItemFactory.java,v 1.2 2006/02/12 04:43:11 minhnn Exp $
26: */
27: public interface FileItemFactory {
28:
29: /**
30: * Create a new {@link FileItem} instance from the supplied parameters and
31: * any local factory configuration.
32: *
33: * @param fieldName The name of the form field.
34: * @param contentType The content type of the form field.
35: * @param isFormField <code>true</code> if this is a plain form field;
36: * <code>false</code> otherwise.
37: * @param fileName The name of the uploaded file, if any, as supplied
38: * by the browser or other client.
39: *
40: * @return The newly created file item.
41: */
42: FileItem createItem(String fieldName, String contentType,
43: boolean isFormField, String fileName);
44: }
|