Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

directory path

Status
Not open for further replies.

sandeepmur

Programmer
Dec 14, 2003
295
PT
Hi,

I have to specify a path for inserting images to a directory located at (/Programas/Apache Group/Tomcat 4.1/webapps/sands/images);

I am getting a null pointer exception. If I just mention /programas or /programas/apache~1 it works fine. How can I specify the path in a better way to make it work?

thnx,
sg
 
Hi again,

I have narrowed down my prob to exactly this. If I remove the spaces in the file path, all my problems would be solved but it might not be possible to hv all filepaths without any spaces.

So is there anyway I can substitute the spaces with something else like %20 or so??

thnx
 
Have you tried putting the directory in quotes ie :

String path = "C:/abc/\"de f\"/ghj";

Also look at the File class documentation - there are methods such as getCanonicalPath() which you may want to fiddle with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top