• 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
  • Paul Clapham
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst
  • Peter Rooke
  • Mikalai Zaikin
Bartenders:
  • Himai Minh

copy file from local host to remote host

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I need to copy a simple file from local file system , to another computer on the same network.

How should i do that in a simple java program ?

Thanks !
 
Marshal
Posts: 27667
89
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
Map a drive to that other host. Copy to a file on that mapped drive.
 
Thomas Houseman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Map a drive to that other host. Copy to a file on that mapped drive.



Thanks,
How do I do that in linux ? (both src and dest are linux).
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are many ways to do it in Linux, ssh, telnet, ftp, etc.

Please google the Java API for all those things.

You may want to take a look at Commons-Net.
 
Thomas Houseman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well , I tried that from winXP to winXP on another machine and it worked great :


BUT, in order to copy to a linux machine, I tried to put this as the new File :


and it doesn't work. How should I format the new File path in order to copy to a linux FS ?


Thanks !
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linux isn't the same as Windows. You can't do it that way. If you prefer to do it that way. You need to create an NFS share and then mount it.
 
Thomas Houseman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Freddy Wong wrote:Linux isn't the same as Windows. You can't do it that way. If you prefer to do it that way. You need to create an NFS share and then mount it.



I'm afraid I can't do that because I have to copy this file into an existing directory dedicated for that.
Is there any other way I can copy this simple file to a linux machine ?
 
Oh. Hi guys! Look at this tiny ad:
Master Gardener Program
https://coderanch.com/t/771761/Master-Gardener-Program
reply
    Bookmark Topic Watch Topic
  • New Topic