[Advanced-java] FileOutputStream & real path

Marco Ferretti marco.ferretti at jrc.it
Thu Jul 24 18:23:20 2003


Hi there guys.=0D
I have a question for you. =0D
I have an utility that reads data from database, plots it and then saves =
the
plot as a jpeg for future needs. =0D
I really had no problems in debugging & using the util since I needed to
publish theese plots on the web.=0D
My question is =0D
    since I create the file as new FileOutPutStream(basepath +"img/"+
fileName)=0D
what happens if some windows fan tries to run from (say tomcat ?) C:\Prog=
ram
Files\Apache\Tomcat ?=0D
If I get the base path from the web server as session.getServletContext()
getRealPath(".") the server's supposed to reply "C:\Program
Files\Apache\Tomcat\webapps\yourApp\." , so I would end up with =0D
FileOutPutStream("C:\Program Files\Apache\Tomcat\webapps\yourApp\img/"+
fileName) .=0D
Do you think the extra space between Program and Files give me problems ?=