Y
Yang Xiao
Hi everybody,
I'm trying to read a txt file to be used by a servlet to display
posting topics, I'm running Tomcat 5.0 on Win2k.
(new FileInputStream("C:/JAVA/Topics.txt"));
This seems to work fine, but not portable, but none of the following
attempts to use a relative path works,
(new FileInputStream("Topics.txt")) -- classes/Topics.txt
(new FileInputStream "../Topics.txt")); -- classes/Topics.txt
(new FileInputStream "/Topics.txt")); -- ROOT/Topics.txt
(new FileInputStream "http://localhost/Topics.txt")); --
ROOT/Topics.txt
Please help!
Thanks,
Yang
I'm trying to read a txt file to be used by a servlet to display
posting topics, I'm running Tomcat 5.0 on Win2k.
(new FileInputStream("C:/JAVA/Topics.txt"));
This seems to work fine, but not portable, but none of the following
attempts to use a relative path works,
(new FileInputStream("Topics.txt")) -- classes/Topics.txt
(new FileInputStream "../Topics.txt")); -- classes/Topics.txt
(new FileInputStream "/Topics.txt")); -- ROOT/Topics.txt
(new FileInputStream "http://localhost/Topics.txt")); --
ROOT/Topics.txt
Please help!
Thanks,
Yang