List of usage examples for org.apache.commons.io FileCleaner exitWhenFinished
public static synchronized void exitWhenFinished()
From source file:org.apache.tapestry5.upload.modules.UploadModule.java
@Scope(ScopeConstants.PERTHREAD) public static MultipartDecoder buildMultipartDecoder(PerthreadManager perthreadManager, RegistryShutdownHub shutdownHub, @Autobuild MultipartDecoderImpl multipartDecoder) { // This is proabably overkill since the FileCleaner should catch temporary files, but lets // be safe.//from w w w .j a va 2 s . c o m perthreadManager.addThreadCleanupListener(multipartDecoder); if (needToAddShutdownListener.getAndSet(false)) { shutdownHub.addRegistryShutdownListener(new Runnable() { public void run() { FileCleaner.exitWhenFinished(); } }); } return multipartDecoder; }