?
Solved

Copy file from one unix server to another using java.

Posted on 2007-03-18
5
Medium Priority
?
2,758 Views
Last Modified: 2007-12-19
I want to copy a file placed at server1 to server2 using java program (Both servers have UNIX platform). Please let me know how can i do this?
Regards,
R
0
Comment
Question by:rajneetbhatia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 18746836
You can copy in a natural way if the destination is exported

http://examples.oreilly.com/jenut/FileCopy.java

Let me know if you need more info
0
 
LVL 6

Assisted Solution

by:SamsonChung
SamsonChung earned 100 total points
ID: 18748064
(I am not entirely sure, but the following is what i would have done)

Create a TCP connection, server and client. (two program, or one if you are really good)

take the file, read it, store it as a serializable Object. (try FILE class)

then set the object over to the other side, which is waiting for the Object.

Once received, recreate the file from the object.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18750384
If you have access to the shared folder on the remote system where you want to copy the file you can just specify the path while copying and Java will take care of it (ensure you have permissions to copy) - sockets are not needed in that case.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question