File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Access and read files on a Windows server from a Java application installed on Unix Box Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Access and read files on a Windows server from a Java application installed on Unix Box" Watch "Access and read files on a Windows server from a Java application installed on Unix Box" New topic
Author

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

GauravS Srivastava
Greenhorn

Joined: Sep 18, 2009
Posts: 1
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
Bartender

Joined: Oct 14, 2005
Posts: 13842

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
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18370

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
IntelliJ Java IDE
 
subject: Access and read files on a Windows server from a Java application installed on Unix Box
 
Threads others viewed
Passing objects to remotely or access database remotely ?
Passing objects to remotely or access database remotely ?
Is it proper to consider using RMI in this case ?
How I connect to remote Unix Box from standalone java application?
Connecting to Unix via Windows
MyEclipse, The Clear Choice