Solved

Copy file from one unix server to another using java.

Posted on 2007-03-18
5
2,699 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
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 25 total points
Comment Utility
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
Comment Utility
(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:mayankeagle
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
word0 challenge 3 56
Python Assistance 7 31
Free Alternative to JIRA 4 52
micro services spring boot application error 3 23
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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.

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now