Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Where am I (in my apache server)???

807569Aug 24 2006 — edited Aug 24 2006
Hi ppl.
I've taken over a web-portal (and I'm not very good at java and apache so far. working on it though) and I'm having a problem knowing where in the file-structure I am.

I've made functions that reads a file, but I don't know how to find it without using an 'absolute path' starting from C:\.
But I want to be able to place this file somewhere (in the WEB_INF-directory preferable) so I can find it wherever I place
this directory at my harddrive.

I've tried to get the current working path with :
String strPath = new File(".").getAbsolutePath();

but all I get is "C:\Winnt\system32\"

Anyone knows how to get the path to either this class-file (or jar-file that it is placed in) or to root of the portal???

Thanx in advance

/Arv
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2006
Added on Aug 24 2006
2 comments
127 views