Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access and read files on a Windows server from a Java application installed on Unix Box  RSS feed

 
GauravS Srivastava
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I need some pointers (and some code if you have) on how to access and read some files (log files, text files) residing on a windows machine from a Java application installed on Unix Box.
Please guide what are the option and which one to use as a best practice?

TIA,
Gaurav
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the two machines are linked by a Windows network then you can use jCIFS to access files on any machine in that network. Security and permissions will apply in the normal way, of course. Or you could perhaps use Unix commands to map a Windows folder into a local name (sorry I don't know the details of how to do that) before accessing the files.

"Best practice" is a meaningless phrase without a context in which to apply it.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Or you could perhaps use Unix commands to map a Windows folder into a local name (sorry I don't know the details of how to do that) before accessing the files.

If the SMB client libraries are installed you can mount SMB (Windows) shares. From an old /etc/fstab file of mine:
I can't remember how the password was handled though; I don't use SMB shares with Unix / Linux anymore.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!