specifying path for file to be read by servlet with Tomcat

From: Yang Xiao (yang2002_99_at_yahoo.com)
Date: 02/08/04


Date: 7 Feb 2004 16:41:18 -0800

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



Relevant Pages

  • Re: Howto: ssh X11 display to Win2k
    ... > box at home to Win2K at work using PuTTY. ... > my graphical display over to my Win2K box. ... VNC works well and will show your entire linux desktop on your Win2K ... Watch the startup messages to see which display number it is ...
    (linux.redhat.misc)
  • win2k drives
    ... My cdrom drive doesn't display in my computer on win2k. ... auto play cd's,and of course iI can't see the cd or dvd. ...
    (microsoft.public.win2000.hardware)
  • How get UTF-8 from urlencoded web form
    ... All my tests are done using ActivePerl 5.8.8.817 under Win2K FR and ... I'm trying to obtain (and display) user data which come from a web form ... Here is a script to show the difference: ... sub ask ...
    (comp.lang.perl.misc)
  • not enough memory or disk space to display
    ... when i open a word document in O2K prof on win2k prof i ... get the error " THERE IS NOT ENOUGH MEMORY OR DISK SPACE ... TO DISPLAY OR PRINT THE PICTURE " how do i get rid of this ...
    (microsoft.public.word.application.errors)
  • not enough memory or disk space to display
    ... when i open a word document in O2K prof on win2k prof i ... get the error " THERE IS NOT ENOUGH MEMORY OR DISK SPACE ... TO DISPLAY OR PRINT THE PICTURE " how do i get rid of this ...
    (microsoft.public.word.drawing.graphics)