001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.fileupload; 018 019/** 020 * <p>A factory interface for creating {@link FileItem} instances. Factories 021 * can provide their own custom configuration, over and above that provided 022 * by the default file upload implementation.</p> 023 * 024 * @version $Id: FileItemFactory.java 1454690 2013-03-09 12:08:48Z simonetripodi $ 025 */ 026public interface FileItemFactory { 027 028 /** 029 * Create a new {@link FileItem} instance from the supplied parameters and 030 * any local factory configuration. 031 * 032 * @param fieldName The name of the form field. 033 * @param contentType The content type of the form field. 034 * @param isFormField <code>true</code> if this is a plain form field; 035 * <code>false</code> otherwise. 036 * @param fileName The name of the uploaded file, if any, as supplied 037 * by the browser or other client. 038 * 039 * @return The newly created file item. 040 */ 041 FileItem createItem( 042 String fieldName, 043 String contentType, 044 boolean isFormField, 045 String fileName 046 ); 047 048}