Solved

Copy file from one unix server to another using java.

Posted on 2007-03-18
5
2,745 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 25 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 25 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

636 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