This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

write to another machine

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have the following code to copy file from one location to another location



here in this program i'm just copying a file from D:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\Samples\\testall.dll to my c drive.
it is copying fine.

now what if i want to copy the same file to another system.
how should be the destination look like( now it is String destination = "c:\\testall.dll"; what changes are to be made here)

assuming i know the ip address(ex. xxx.xxx.xxx.xx)/system name( ex. java3) of the other machine what should be the destination address.

any help please..

thanks in advance

 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this is the same problem you're grappling with in the other posts, then this code is part of an applet, and it should copy a file from a server to the local machine; is that correct? If so, then the problem is not actually copying a file to a different machine, but downloading it from the server and saving it to the LOCAL machine (where no IP address is needed), isn't it?

I outlined three approaches to this problem in this post; let's continue the discussion over there.
 
bharani rao
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ulf,

you are absolutely right ulf.. this code will become a part of that applet.
what my colleague suggested is that, if i first successfully completed this procedure it is then easily called in that applet.
that is why i'm trying this.. he suggested to use nio api so i'm using that..

you suggested three procedures, but those are little confusing considering my java knowledge..

thank you
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does figuring out how to copy a file TO a different machine help you with downloading a file FROM a server to the local machine? Even more so if it's unlikely that the server is even accessible through file I/O?

You are going wrong on a very fundamental level; all this tinkering with file copying will get you precisely nowhere.

If you have questions about the approaches I described, please ask them in the other topic. (By the way, using NIO doesn't add anything to what I suggested over there.)
 
bharani rao
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

ok i will start a new thread
reply
    Bookmark Topic Watch Topic
  • New Topic