Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352058 - Allow to change location of temporary directory for rwt-resources
Summary: Allow to change location of temporary directory for rwt-resources
Status: CLOSED WONTFIX
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 04:16 EDT by Dominik Stadler CLA
Modified: 2011-07-15 04:05 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Stadler CLA 2011-07-14 04:16:41 EDT
Build Identifier: 1.4.0.20110614-2335

We are using RAP/RWT to build a small Tomcat based web application which single-sources an originally SWT based GUI application. It works very nice, however when we install the resulting product on a Windows machine with default access rights, we get permission problems because the location where we store the files requires admin rights, i.e. under c:\program files\...

It seems RAP stores temporary files in a directory called "rwt-resources" underneath of the folder of the web application. 

Usually in web application containers, you can specify where work-files are stored so you can separate installation files from temporary files. 

The related code seems to be in ResourceManagerImpl.getDiskLocation() where the hardcoded path is built based on the root-directory of the web application.

Is it feasible to get a property for the location of the rwt-resources folder that can be used to store temporary files in a separate folder?

Reproducible: Always
Comment 1 Rüdiger Herrmann CLA 2011-07-14 08:51:45 EDT
How do you deploy your application: as a standalone RWT application? or as a an OSGi/Equinox app embedded into a WAR file?
Comment 2 Dominik Stadler CLA 2011-07-14 10:49:21 EDT
We start an instance of Tomcat Web Container as embedded application and have RWT as webapp running inside there, so no OSGi. We have a web.xml where we define "org.eclipse.rwt.internal.engine.RWTDelegate" as delegate and some listeners and context-params to configure the RWT application.
Comment 3 Rüdiger Herrmann CLA 2011-07-14 11:05:48 EDT
In principle, the root-path used by ResourceManagerImpl.getDiskLocation() could be made configurable, however I doubt that this will solve your problem.
The files below 'rwt-resources' are those to be delivered to the client (e.g. images). IIRC, in a standalone scenario the 'default servlet' of the servlet engine delivers resource requests from the root of the web app.
If you are running an embedded tomcat, you should be able to specify where web-apps are placed in the file system and re-locate them in a writeable location.
We are running Tomcat embedded for integration tests and are creating temp directories for the web-apps. The code can be found in the RAP source code repository [1] under cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.cluster.testfixture (see class TomcatEngine)
Please let me know if that helps.
[1] http://eclipse.org/rap/source
Comment 4 Dominik Stadler CLA 2011-07-15 04:05:27 EDT
Yes, that is the workaround that I was planning to try if there is no way to configure this in RWT/Tomcat directly.

So I probably have to copy over the static files of the webapp to a temp location and choose that as webapp folder for Tomcat.