This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSF and the fly likes working with files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "working with files" Watch "working with files" New topic

working with files

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 197

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 ?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17046

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.

An IDE is no substitute for an Intelligent Developer.
chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 197
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: working with files
It's not a secret anymore!