com.phloc.web.fileupload.IFileItemFactory Maven / Gradle / Ivy
/**
* Copyright (C) 2006-2015 phloc systems
* http://www.phloc.com
* office[at]phloc[dot]com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.phloc.web.fileupload;
import java.io.File;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
*
* A factory interface for creating {@link IFileItem} instances. Factories can
* provide their own custom configuration, over and above that provided by the
* default file upload implementation.
*
*
* @author Martin Cooper
* @version $Id: FileItemFactory.java 479262 2006-11-26 03:09:24Z niallp $
*/
public interface IFileItemFactory
{
/**
* Define where to store files
*
* @param aRepository
* The directory to use. May be null
.
*/
void setRepository (@Nullable File aRepository);
/**
* Create a new {@link IFileItem} instance from the supplied parameters and
* any local factory configuration.
*
* @param sFieldName
* The name of the form field.
* @param sContentType
* The content type of the form field.
* @param bIsFormField
* true
if this is a plain form field; false
* otherwise.
* @param sFileName
* The name of the uploaded file, if any, as supplied by the browser or
* other client.
* @return The newly created file item.
*/
@Nonnull
IFileItem createItem (String sFieldName, String sContentType, boolean bIsFormField, String sFileName);
@Nonnull
List getAllTemporaryFiles ();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy