Results 1 to 2 of 2
Thread: Communication with remote host
- 03-16-2010, 03:58 PM #1
Communication with remote host
Hello programmers :)
I created a program that extracts from a folder files within 2 dates as input and to copy each ones with a different name. Now i have to communicate whit a folder in a remote host. My answer is: what should i do to implement this function? Ok, i need an user login and password, but i'd like to know which class(es) can grant me connection with the file system of the remote host and allow me to copy.
- 03-16-2010, 04:48 PM #2Senior Member
- Join Date
- Dec 2009
- Belgrade, Serbia
- Rep Power
There are different approaches to this.
One is discussed here:
It is Socket Client/Server with keys...
Other can be much easier.
Have you considered uisng FTP for this? If you have FTP server,
you can use "org.apache.commons.net.ftp.FTPClient" from
Commons Net 2.0 API for this.
If you want to work with file system only and not with FTP
you can use secure copy command between 2 machines (SCP).
Initially you exchange keys between 2 machines - SSH.
When client wants to perform copying to server
you create a call of SCP command (unix shell) form external process.
Now what OS do you have for client and server?
If you have Windows you will nedd small help from app like
PuTTY: a free telnet/ssh client and PSCP
for key creation:
PuTTY Download Page
When you are done with keys you need to perform copying with SCP command using key created:
Process p = Runtime.getRuntime().exec(command);
- - -
So describe what you will use
so I can help you futher on this
- By anurit in forum Java AppletsReplies: 2Last Post: 03-04-2010, 12:33 PM
- By subhayan in forum NetworkingReplies: 7Last Post: 02-24-2010, 09:00 PM
- By isotoper in forum New To JavaReplies: 4Last Post: 12-24-2009, 05:41 PM
- By krishnaraoveera1294 in forum AWT / SwingReplies: 4Last Post: 03-13-2009, 11:56 PM
- By kairamr in forum EclipseReplies: 0Last Post: 10-31-2008, 08:07 PM