java - Determining the relative path -


i have working absolute path

string path = "c:/projects/isi7/releases/release_15.2/ext_js/src/main/webapp/web- inf/classes/commoncomponents/applicationresources_"+ language + ".properties"; 

i want relative path. thought relative path was:

string path = "classes/commoncomponents/applicationresources_"+ language + ".properties"; 

but filenotfound exception

what have tried is:

string path = "commoncomponents/applicationresources_"+ language + ".properties";  

and didn't work either. using jdk 1.6 , windows os.

to sure working dir try this:

file f = new file("."); system.out.println(f.getabsolutepath()); 

Comments