• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic