On Wed, 2002-08-14 at 11:37, Shapira, Yoav wrote:
> Hi,
> 
> >I see that the spec mentions "private temporary directory" - I need a
> >permananent directory - by temporary I take it to mean that I can't
> >count on the files "sticking around". Is my understanding here flawed?
> 
> Your understanding as far as a temporary directory is correct.  If you
> need a permanent directory, you can:
> 
> - Specify one as a parameter (resource-ref, init-param to a servlet,
> context-param etc.).

Right, this is what I tried (set an init-param, read it in the JSP, pass
it to the object via a "SetLogDirectory()" method - but no files.

> 
> - Use another storage medium, e.g. a database.

Well, the problem then is debugging problems hitting the db - text files
are the lowest common denominator and simplest way of dropping messages.
If I log to a db, then if I can't hit the db then no logging ;^(

> I'm sorry, I don't have your original message in front of me.  Are you
> using a logging solution e.g. log4j or commons-logging, or are you
> constricted to relying only on the ServletContext.log() methods?  Log4j
> etc will let you configure the log files to whatever detail level you
> want, including path and separate log files per class.

I'm just doing simple file I/O (via PrintWriter() class)
I had looked at Log4j, but I wanted to port the existing code, not
rewrite it.
Plus I assume if I'm having trouble doing simple file I/O I'll have the
same problem using an different class.

> Why can't you use the temporary directory for this?  Unless you want to
> files to persist across server restarts, 
Yes, I need them to persist.

> in which case you would either
> put them in a DB 
In one case I have I *must* save the data to a file (it starts out in
the db) - this is not a technical issue, but rather a legal issue we
have (i.e. we must save to a file because that's what the user
downloads, if we save it in a db then we can't say we've kept copies of
all files, yada yada yada - typical CYA lawyer stuff)

> or tell your servlets what directory to use via the
> param methods mentioned above.
Right, that's what I tried. But, the files don't appear - so I was
wondering if this is a Tomcat4 issue (security / config / ???) as file
I/O worked with these classes under Tomcat 3.2

-Steve


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to