Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

working with files

 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my web application I am creating a file that eventually the user will download.
This file should be stored in the memory until the user will download it.

So I am using for this task.

Is it a good approach or maybe there is a better why for creating files ?

Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, tempfiles aren't usually held in memory, but if you want to create a temporary file and not care whether it's in memory or on disk, then createTempFile is a good choice.

There's nothing in JSF that is specific to temp files, but J2EE containers usually override the tempfile directory location that the JVM would be using by default. For example, on a Linux system, instead of /tmp, it would be set to TOMCAT_HOME/work, unless you overrode the override.
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic