Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311550

Summary: The WebAppProvider should allow setTempDirectory
Product: [RT] Jetty Reporter: Jan Bartel <janb>
Component: serverAssignee: Joakim Erdfelt <joakim.erdfelt>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: gregw, jetty-inbox
Version: 7.0.0   
Target Milestone: 7.0.2.RC0   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 294531    

Description Jan Bartel CLA 2010-05-04 09:56:33 EDT
The WebAppProvider should allow a tmp directory to be set for all of the webapps it deploys to use.
Comment 1 Joakim Erdfelt CLA 2010-05-12 17:00:40 EDT
I can't see a use of a Temp Directory at all in the WebAppProvider.
Hard for me to make it configurable until then.
Comment 2 Greg Wilkins CLA 2010-06-09 18:22:50 EDT
Joakim,

I assume this means to set the root temp directory for contexts that are deployed.

WebAppContext has a horrid search pattern for where it will put it's temp directory - which in the end comes down to under the tmp dir system property.

So perhaps have it settable on the deployer is not a bad thing.
Comment 3 Jan Bartel CLA 2010-06-09 22:39:34 EDT
Joakim,

Greg is right. I meant that the WebAppProvider should allow a tmp directory to be set which is set on all of the WebAppContexts that it deploys - otherwise there's no way to change the tmp dir for non-context xml based webapps. Its a very small fix to add in.

I'm assigning back to you.
Comment 4 Joakim Erdfelt CLA 2010-06-14 18:31:25 EDT
Work completed in r2000 on trunk.

The nuances of WebAppProvider managing multiple WebAppContext's, meant that a simple TempDirectory setting wouldn't work with more than 1 war file.
And setting the WebAppContext.TEMPDIR javax.servlet Attribute suffers from the same end result.
Also, using the new WebAppProvider.setTempDir(File) to set the java.io.tmpdir System Property was deemed too dangerous of a solution (reprocussions and potential for regressions were too high).
So a new WebAppContext.BASETEMPDIR attribute was created to work with the WebInfConfiguration.resolveTempDirectory(WebAppContext) to gain benefit of the WebInfConfiguration.getCanonicalNameForWebAppTmpDir(WebAppContext) to generate a unique temp directory for each deployed WAR, while treating the WebAppProvider.setTempDir(File) as a base directory for all of the war deployment temp directories.