tmp0 and other server directories [message #157426] |
Fri, 20 January 2006 02:08  |
Eclipse User |
|
|
|
Originally posted by: dwelzel+eclipse.gmail.com
Is there any way to find out the directory to which your server is
deployed? I have several ant scripts and other projects which drop jars
into the shared folder of my server and I find I have to hard code the
path to the server, which is a bit of a pain. In particular, the
directory changes to tmp1 (etc) if you recreate the server project. I'd
like to find a cleaner way to get this data or deploy jars out to
specific directories on the server.
|
|
|
|
|
Re: tmp0 and other server directories [message #157582 is a reply to message #157535] |
Fri, 20 January 2006 19:39  |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
The other approach would be to interact with the code via API:
http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. wst.doc.isv/reference/api/org/eclipse/wst/server/core/Server Core.html
You should be able to get hold of all Serves via ServerCore.getServers(), and then iterate through those. There's also a ServerCore.getDefaultServer(), which might be useful if you only have one. From that, you can getRuntime(), which has a getLocation() that might also help you locate the right place to go. (There's also a working copy, which is likely to correspond with the tmp directories.)
One advantage of using the API (if it works) is that you don't have to write the parsing stuff yourself. On the other hand, it maybe a waste of time investigating :-) At the very least, you'll be able to get the Server's ID, which is fairly likely to correspond with the integer after the tmp in the directory name, I'm guessing.
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.02430 seconds