File path in App Engine

Showing 1-5 of 5 messages
File path in App Engine Ftaylor 1/4/10 3:45 PM
Hello,

I have recently started using App Engine for a project I am working
on, and I have a simple question.

I have a file in the war/WEB-INF directory of my app <filename.txt>.
When I try BufferedReader b = new BufferedReader(new FileReader(new
File(<filename.txt>))); I get a FileNotFoundException.

What path should I use when trying to access files in the war/WEB-INF
directory? I have tried what seem to me to be the obvious ones and I
have read the faq on this (which just tells you to put files in that
directory).

Thanks,

Finbarr

Re: File path in App Engine seleronm 1/6/10 7:32 PM

Hi,

It might be solved by this though is not a direct answer.

Follow this thread:
http://groups.google.co.jp/group/google-appengine-java/browse_thread/thread/474203bfe0936636/080b511624096ba8#080b511624096ba8

Please Try.
thanks.

Re: File path in App Engine Ftaylor 1/7/10 2:46 AM
Hello,

I have tried this but I always get a
java.security.AccessControlException: access denied
(java.io.FilePermission /names.txt read)

Anyone know how to resolve this?

Thanks,

Finbarr

On Jan 7, 3:32 am, m seleron <seler...@gmail.com> wrote:
> Hi,
>
> It might be solved by this though is not a direct answer.
>
> Follow this thread:http://groups.google.co.jp/group/google-appengine-java/browse_thread/...

>
> Please Try.
> thanks.
>
>
>
> > Hello,
>
> > I have recently started using App Engine for a project I am working
> > on, and I have a simple question.
>
> > I have a file in the war/WEB-INF directory of my app <filename.txt>.
> > When I try BufferedReader b = new BufferedReader(new FileReader(new
> > File(<filename.txt>))); I get a FileNotFoundException.
>
> > What path should I use when trying to access files in the war/WEB-INF
> > directory? I have tried what seem to me to be the obvious ones and I
> > have read the faq on this (which just tells you to put files in that
> > directory).
>
> > Thanks,
>
> > Finbarr

Re: File path in App Engine seleronm 1/7/10 5:11 PM
I tried a little.

I put the file(names.txt) in /WEB-INF directly

The following are sources that I tested.

String FileName = "names.txt";
File file = new File(FileName);
BufferedReader bufferedReader = new BufferedReader(new FileReader
(file));

The processing seems in my test for normality.

I might not correctly understand the content of the question or
There is a possibility it is not in the cause for the source code not
to be able to read a file but in the cause with the environment, too.

Please Confirm.
thanks.

Re: File path in App Engine Ftaylor 1/7/10 2:01 PM
I got it to work by just using a File. Didn't change anything, it just
seemed to start working of its own accord.

Finbarr