You need to get the real path using the ServletContext. For example, to get
your WEB-INF:
getServletContext().getRealPath("/WEB-INF/")
Stephen
On Tue, Mar 8, 2011 at 9:34 PM, Nguyen Trung Kien
<[email protected]>wrote:
> Hi all,
> I've read old discussion but i can not find out what happened to my
> project.
> I want to read an .txt from a servlet from my java project. Like
>
> BufferedReader in = new BufferedReader(
> new InputStreamReader(
> new FileInputStream("data/cafe.txt"), "UTF8"));
>
> with appengine-web.xml like this
>
> <static-files>
> <include path="/data/cafe.txt"/>
> </static-files>
>
> and my cafe.txt file is put under Web-INF/data/
>
> but when my program run, the error "file not found " is raised?
> So where is the problem with my project??
> Thank you all,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.