Solved

Copy file from one unix server to another using java.

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

Suggested Solutions

Title # Comments Views Activity
Maven Project: Hibernate Dependencies Conflict 10 96
hibernate example using maven 12 113
How to determine if a string is a valid SHA value 7 58
Html Table Looping (part 2) 5 42
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

710 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