aspose file tools*
The moose likes Java in General and the fly likes problem in copying files from/to different machines using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem in copying files from/to different machines using java" Watch "problem in copying files from/to different machines using java" New topic
Author

problem in copying files from/to different machines using java

Priyha Jootu
Ranch Hand

Joined: Sep 13, 2001
Posts: 47
Hi all,
I am trying to copy some files in a directory from one computer to another using java's Runtime.exec(). I want to copy some files from
\\d4598\public\soe_test\ directory to c:\try in my local machine. the "d4598" in the above is the machine name. I am mapping the remote machine d4598 to I: using "net use" command and then copying the files using "copy" command, but the copy command doesn't work, why is that?
Here's the code:

Since the copy didnt work, i tried to do it using the FileInputStream or bufferedstream, etc. First step is to see what files exist in that directory, even this doesn't work, what is wrong in my code, couldn't figure out.
Can anyone please help me with this?
Thanks,
Priyha
[ July 21, 2003: Message edited by: Priyha Jootu ]
Priyha Jootu
Ranch Hand

Joined: Sep 13, 2001
Posts: 47
The error I am getting when i run this is:

Anyone know what it says?
Thanks,
Priyha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in copying files from/to different machines using java