Package com.helger.web.scope.multipart
Class GlobalDiskFileItemFactory
- java.lang.Object
-
- com.helger.scope.singleton.AbstractSingleton
-
- com.helger.web.scope.singleton.AbstractGlobalWebSingleton
-
- com.helger.web.scope.multipart.GlobalDiskFileItemFactory
-
- All Implemented Interfaces:
com.helger.scope.IScopeDestructionAware,IFileItemFactory,IWebSingleton
public final class GlobalDiskFileItemFactory extends AbstractGlobalWebSingleton implements IFileItemFactory
Wrapper around aDiskFileItemFactory, that is correctly cleaning up, when the servlet context is destroyed.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description GlobalDiskFileItemFactory()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DiskFileItemcreateItem(String sFieldName, String sContentType, boolean bIsFormField, String sFileName)Create a newIFileIteminstance from the supplied parameters and any local factory configuration.com.helger.commons.collection.impl.ICommonsList<File>getAllTemporaryFiles()static GlobalDiskFileItemFactorygetInstance()protected voidonDestroy(com.helger.scope.IScope aScopeInDestruction)voidsetRepository(File aRepository)Define where to store filesStringtoString()-
Methods inherited from class com.helger.web.scope.singleton.AbstractGlobalWebSingleton
getAllGlobalSingletons, getGlobalSingleton, getGlobalSingletonIfInstantiated, isGlobalSingletonInstantiated
-
Methods inherited from class com.helger.scope.singleton.AbstractSingleton
getAllSingletons, getSingleton, getSingletonIfInstantiated, getSingletonScopeKey, isDestroyed, isInDestruction, isInInstantiation, isInPreDestruction, isInstantiated, isSingletonInstantiated, isUsableObject, onAfterInstantiation, onBeforeDestroy, onBeforeScopeDestruction, onScopeDestruction, readAbstractSingletonFields, setDestroyed, setInDestruction, setInInstantiation, setInPreDestruction, setInstantiated, writeAbstractSingletonFields
-
-
-
-
Constructor Detail
-
GlobalDiskFileItemFactory
@UsedViaReflection @Deprecated(forRemoval=false) public GlobalDiskFileItemFactory()
Deprecated.
-
-
Method Detail
-
getInstance
@Nonnull public static GlobalDiskFileItemFactory getInstance()
-
onDestroy
protected void onDestroy(@Nonnull com.helger.scope.IScope aScopeInDestruction)
- Overrides:
onDestroyin classcom.helger.scope.singleton.AbstractSingleton
-
setRepository
public void setRepository(@Nullable File aRepository)
Description copied from interface:IFileItemFactoryDefine where to store files- Specified by:
setRepositoryin interfaceIFileItemFactory- Parameters:
aRepository- The directory to use. May benull.
-
createItem
@Nonnull public DiskFileItem createItem(String sFieldName, @Nullable String sContentType, boolean bIsFormField, @Nullable String sFileName)
Description copied from interface:IFileItemFactoryCreate a newIFileIteminstance from the supplied parameters and any local factory configuration.- Specified by:
createItemin interfaceIFileItemFactory- Parameters:
sFieldName- The name of the form field.sContentType- The content type of the form field.bIsFormField-trueif this is a plain form field;falseotherwise.sFileName- The name of the uploaded file, if any, as supplied by the browser or other client.- Returns:
- The newly created file item.
-
getAllTemporaryFiles
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<File> getAllTemporaryFiles()
- Specified by:
getAllTemporaryFilesin interfaceIFileItemFactory
-
toString
public String toString()
- Overrides:
toStringin classcom.helger.scope.singleton.AbstractSingleton
-
-