aspose file tools*
The moose likes I/O and Streams and the fly likes Storing files in a central place (other than the database) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Storing files in a central place (other than the database)" Watch "Storing files in a central place (other than the database)" New topic
Author

Storing files in a central place (other than the database)

Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
I need to be able to create a file from user entered input through a web-app and store it in a central file system. Storing it in the database as a CLOB/BLOB/VARBINARY is not an option. The web-app could possibly farm out the request to any one of the cluster JVMs, and I need to able to store the created file in this central system from any JVM.
All the JVMS are in a UNIX enviroment. How can I store files in
a central place from different JVMS?
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I don't quite see what the problem is. Surely it's a simple matter to hard-code the full path to the shared place in each application:
File f = new File("/usr/me/someplace");
Then they can all just write files in that directory.
I guess you have dismissed this approach, so what am I missing?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
That is the approach I would like to use. Isn't the path /usr/bin... local to the machine where it is called? How do I fully qualify the path name possibly with a machine name so
that /usr/bin/whatever maps to that shared directory? I guess this is more of a UNIX question.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you are not on a network where you can directly path to the directory, then you will need to ftp the file.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Most Unix systems allow you to mount directories from other machines using nfs or various other protocols. I'd recommend that you do this if you can, as it will also allow you to make sure you deploy the same version of software to each of your clustered VMs.
As a small side note, your initial message didn't mention that these multiple VMs were to be on separate machines. A lot of people like to cluster several VMs even on a single machine, so that of anything causes a VM to crash or lock up, then the app can still carry on.
Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
Was wondering if LDAP would help here?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing files in a central place (other than the database)