Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File I/O to a shared network drive

 
Donald Winston
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to write and read to a file server from a distributed servlet. (I happen to be using macs for both the app servers and the file server).
Can I use the File class?
If so do I use a URI or a conventional absolute pathname to specify the file?
What would be the pathname or uri be if the shared directory I'm reading and writing to is /data, the server name is blue, and the ip address is 10.1.1.2? Do file servers use a port number? If so then assume it's 9999.

How much slower will this be then using a local drive? (I don't think this is feasible with a distributed app)
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to use File then you can add NFS to your servers. BTW, if you Google it, NFS is Network File System - not Need For Speed.
 
Donald Winston
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On a mac I should be able to just turn file sharing on. I used to use shared network drives on Windows without doing anything geeky. I should be able to do the same thing on a mac.

My question is about the pathname or uri that would be used and wether or not I can use the File class which is designed for local drives.

Simpler is better.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic