Class JavaxFileCleaner
java.lang.Object
org.apache.commons.fileupload2.javax.JavaxFileCleaner
- All Implemented Interfaces:
- EventListener,- javax.servlet.ServletContextListener
A servlet context listener, which ensures that the 
FileCleaningTracker's reaper thread is terminated, when the web application is destroyed.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringAttribute name, which is used for storing an instance ofFileCleaningTrackerin the web application.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcontextDestroyed(javax.servlet.ServletContextEvent sce) Called when the web application is being destroyed.voidcontextInitialized(javax.servlet.ServletContextEvent sce) Called when the web application is initialized.static org.apache.commons.io.FileCleaningTrackergetFileCleaningTracker(javax.servlet.ServletContext servletContext) Gets the instance ofFileCleaningTracker, which is associated with the givenServletContext.static voidsetFileCleaningTracker(javax.servlet.ServletContext servletContext, org.apache.commons.io.FileCleaningTracker tracker) Sets the instance ofFileCleaningTracker, which is associated with the givenServletContext.
- 
Field Details- 
FILE_CLEANING_TRACKER_ATTRIBUTEAttribute name, which is used for storing an instance ofFileCleaningTrackerin the web application.
 
- 
- 
Constructor Details- 
JavaxFileCleanerpublic JavaxFileCleaner()Constructs a new instance.
 
- 
- 
Method Details- 
getFileCleaningTrackerpublic static org.apache.commons.io.FileCleaningTracker getFileCleaningTracker(javax.servlet.ServletContext servletContext) Gets the instance ofFileCleaningTracker, which is associated with the givenServletContext.- Parameters:
- servletContext- The servlet context to query
- Returns:
- The contexts tracker
 
- 
setFileCleaningTrackerpublic static void setFileCleaningTracker(javax.servlet.ServletContext servletContext, org.apache.commons.io.FileCleaningTracker tracker) Sets the instance ofFileCleaningTracker, which is associated with the givenServletContext.- Parameters:
- servletContext- The servlet context to modify
- tracker- The tracker to set
 
- 
contextDestroyedCalled when the web application is being destroyed. CallsFileCleaningTracker.exitWhenFinished().- Specified by:
- contextDestroyedin interface- javax.servlet.ServletContextListener
- Parameters:
- sce- The servlet context, used for calling- getFileCleaningTracker(ServletContext).
 
- 
contextInitializedCalled when the web application is initialized. Does nothing.- Specified by:
- contextInitializedin interface- javax.servlet.ServletContextListener
- Parameters:
- sce- The servlet context, used for calling- setFileCleaningTracker(ServletContext, FileCleaningTracker).
 
 
-