This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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: 27288
87
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: 22665
127
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic