Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311550 - The WebAppProvider should allow setTempDirectory
Summary: The WebAppProvider should allow setTempDirectory
Status: CLOSED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.0.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 7.0.2.RC0   Edit
Assignee: Joakim Erdfelt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 294531
  Show dependency tree
 
Reported: 2010-05-04 09:56 EDT by Jan Bartel CLA
Modified: 2010-06-14 18:31 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.