RE: Best place to store files ?

2004-12-08 Thread Shapira, Yoav

Hi,
What Wendy said is right on, so I'm glad you're already down that path.

If the files are temporary, i.e. you don't mind them being erased when the 
server restarts, you can use the javax.servlet.context.tempdir context 
attribute.  That's the portable, preferred way to handle temporary files.  For 
permanent files, do what Wendy said.

Tomcat is not deficient or lacking here in any way: if something is lacking, 
it's the Servlet Spec, but I personally don't think it's lacking because 
there's still a use-case for the no-filesystem servlet container.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Eric VERGNAUD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 8:52 PM
To: Tomcat Users List
Subject: Re: Best place to store files ?

le 8/12/04 0:15, Wendy Smoak à [EMAIL PROTECTED] a écrit :

 From: Eric VERGNAUD [EMAIL PROTECTED]
 Yes it's simple. I was just wondering whether there was a preferred
method
 for this, and maybe a folder in the Tomcat directory for that purpose.

 Nothing in the Servlet Specification requires Tomcat to provide you with
a
 permanent place to put uploaded files.

 My advice would be to put them outside of Tomcat, and write a thin layer
to
 insulate the Servlet from whatever decisions you're making today.  That
way,
 if you decide at some point in the future to put the files in a database,
or
 do something else with them, you don't have to mess with the Servlet
code.
 Your Servlet shouldn't know or care where the files are, it should just
call
 'read' or 'write' and let the data access layer deal with the details.

Which is what I already do. As a matter of fact, the layer I'm using makes
it look like a database.

The only thing I was looking for is the preferred place for storing files.
If there is none, that's ok.

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---



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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Best place to store files ?

2004-12-08 Thread Peter Crowther
 From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
 Tomcat is not deficient or lacking here in any way: if 
 something is lacking, it's the Servlet Spec, but I personally 
 don't think it's lacking because there's still a use-case for 
 the no-filesystem servlet container.

Hmm.  Sorry, Yoav, but I think that's specious.  There's still a
use-case for the motorcycle, but it doesn't invalidate the use-case for
the station wagon.  Similarly, there is a use-case for the no-filesystem
servlet container, but I would argue that that is a special case
(possibly achieved via configuration) of a more general servlet
container.

- Peter

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



RE: Best place to store files ?

2004-12-08 Thread Shapira, Yoav

Hi,

 From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
 Tomcat is not deficient or lacking here in any way: if
 something is lacking, it's the Servlet Spec, but I personally
 don't think it's lacking because there's still a use-case for
 the no-filesystem servlet container.

Hmm.  Sorry, Yoav, but I think that's specious.  There's still a
use-case for the motorcycle, but it doesn't invalidate the use-case for
the station wagon.  Similarly, there is a use-case for the
no-filesystem
servlet container, but I would argue that that is a special case
(possibly achieved via configuration) of a more general servlet
container.

I didn't say the no-filesystem container use-case pre-empts the one with
filesystem.  So specious is not a good word.  But then again, I don't
really care if you think it's specious or not, as I said, this is
Spec-mandated and not Tomcat's call to make.  Accordingly, any
complaints of the specious and other type should be directed to the
Servlet Expert Group.

Yoav Shapira http://www.yoavshapira.com




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Best place to store files ?

2004-12-07 Thread Eric VERGNAUD
Hi,

I'm developing a servlet which needs to handle file uploads and downloads. I
manage to store the files in a directory inside my servlet, but each time I
upload a new version of my servlet, the files are destroyed.

Is there a preferred place to store such files in Tomcat, or is this
entirely up to the developer and the catalina.policy file ?

Is there a way to tell Tomcat NOT to erase existing files in a servlet, but
only overwrite them with files from the war file ?

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---



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



Re: Best place to store files ?

2004-12-07 Thread Larry Meadors
Put them in a database instead?

 [EMAIL PROTECTED] 12/07/04 3:11 PM 
Hi,

I'm developing a servlet which needs to handle file uploads and
downloads. I
manage to store the files in a directory inside my servlet, but each
time I
upload a new version of my servlet, the files are destroyed.

Is there a preferred place to store such files in Tomcat, or is this
entirely up to the developer and the catalina.policy file ?

Is there a way to tell Tomcat NOT to erase existing files in a servlet,
but
only overwrite them with files from the war file ?

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---



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



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



Re: Best place to store files ?

2004-12-07 Thread Eric VERGNAUD
le 7/12/04 23:20, Larry Meadors à [EMAIL PROTECTED] a écrit :

 Put them in a database instead?
 

Thanks, but not an option in this case.

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---



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



Re: Best place to store files ?

2004-12-07 Thread Parsons Technical Services
I use a directory that belongs to the owner of Tomcat and is located outside 
of the Tomcat directory. It really is a matter of preference. As for not 
overwriting the files, I have yet to read anything on this. How would you 
determine which file to keep and which to overwrite? If you never deleted 
any files then the directory would fill with abandoned file that belonged to 
prior versions of your app. That means you would have to manage the files 
manually and with that is the chance to delete a file belonging to your app.

Simple terms, pick a place just for them use it.
Doug
- Original Message - 
From: Eric VERGNAUD [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 5:11 PM
Subject: Best place to store files ?


Hi,
I'm developing a servlet which needs to handle file uploads and downloads. 
I
manage to store the files in a directory inside my servlet, but each time 
I
upload a new version of my servlet, the files are destroyed.

Is there a preferred place to store such files in Tomcat, or is this
entirely up to the developer and the catalina.policy file ?
Is there a way to tell Tomcat NOT to erase existing files in a servlet, 
but
only overwrite them with files from the war file ?

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---

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


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


Re: Best place to store files ?

2004-12-07 Thread Eric VERGNAUD
le 7/12/04 23:33, Parsons Technical Services à
[EMAIL PROTECTED] a écrit :

 I use a directory that belongs to the owner of Tomcat and is located outside
 of the Tomcat directory. It really is a matter of preference. As for not
 overwriting the files, I have yet to read anything on this. How would you
 determine which file to keep and which to overwrite? If you never deleted
 any files then the directory would fill with abandoned file that belonged to
 prior versions of your app. That means you would have to manage the files
 manually and with that is the chance to delete a file belonging to your app.
 
 Simple terms, pick a place just for them use it.
 
 Doug

Yes it's simple. I was just wondering whether there was a preferred method
for this, and maybe a folder in the Tomcat directory for that purpose.

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---



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



Re: Best place to store files ?

2004-12-07 Thread Parsons Technical Services
Not to my knowledge. But it has been known to be lacking at times.
Doug
- Original Message - 
From: Eric VERGNAUD [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 5:55 PM
Subject: Re: Best place to store files ?

le 7/12/04 23:33, Parsons Technical Services à
[EMAIL PROTECTED] a écrit :
I use a directory that belongs to the owner of Tomcat and is located 
outside
of the Tomcat directory. It really is a matter of preference. As for not
overwriting the files, I have yet to read anything on this. How would you
determine which file to keep and which to overwrite? If you never deleted
any files then the directory would fill with abandoned file that belonged 
to
prior versions of your app. That means you would have to manage the files
manually and with that is the chance to delete a file belonging to your 
app.

Simple terms, pick a place just for them use it.
Doug
Yes it's simple. I was just wondering whether there was a preferred method
for this, and maybe a folder in the Tomcat directory for that purpose.
---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---

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


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


Re: Best place to store files ?

2004-12-07 Thread Wendy Smoak
From: Eric VERGNAUD [EMAIL PROTECTED]
 Yes it's simple. I was just wondering whether there was a preferred method
 for this, and maybe a folder in the Tomcat directory for that purpose.

Nothing in the Servlet Specification requires Tomcat to provide you with a
permanent place to put uploaded files.

My advice would be to put them outside of Tomcat, and write a thin layer to
insulate the Servlet from whatever decisions you're making today.  That way,
if you decide at some point in the future to put the files in a database, or
do something else with them, you don't have to mess with the Servlet code.
Your Servlet shouldn't know or care where the files are, it should just call
'read' or 'write' and let the data access layer deal with the details.

-- 
Wendy Smoak


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



Re: Best place to store files ?

2004-12-07 Thread Eric VERGNAUD
le 8/12/04 0:15, Wendy Smoak à [EMAIL PROTECTED] a écrit :

 From: Eric VERGNAUD [EMAIL PROTECTED]
 Yes it's simple. I was just wondering whether there was a preferred method
 for this, and maybe a folder in the Tomcat directory for that purpose.
 
 Nothing in the Servlet Specification requires Tomcat to provide you with a
 permanent place to put uploaded files.
 
 My advice would be to put them outside of Tomcat, and write a thin layer to
 insulate the Servlet from whatever decisions you're making today.  That way,
 if you decide at some point in the future to put the files in a database, or
 do something else with them, you don't have to mess with the Servlet code.
 Your Servlet shouldn't know or care where the files are, it should just call
 'read' or 'write' and let the data access layer deal with the details.

Which is what I already do. As a matter of fact, the layer I'm using makes
it look like a database.

The only thing I was looking for is the preferred place for storing files.
If there is none, that's ok.

---
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
---



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