Results 1 to 2 of 2
Thread: Communication with remote host
- 03-16-2010, 02: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, 03:48 PM #2
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
There are different approaches to this.
One is discussed here:
1)
Java security program
It is Socket Client/Server with keys...
Other can be much easier.
2)
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.
3)
3.1) KEYS
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
3.2)
When you are done with keys you need to perform copying with SCP command using key created:
Where command is SCP command...Java Code:Process p = Runtime.getRuntime().exec(command);
- - -
So describe what you will use
so I can help you futher on this
regards!
Similar Threads
-
How write created file on remote host without saving on HDD?
By anurit in forum Java AppletsReplies: 2Last Post: 03-04-2010, 11:33 AM -
Using input and output streams for remote interprocess communication
By subhayan in forum NetworkingReplies: 7Last Post: 02-24-2010, 08:00 PM -
copy file from local host to remote host
By isotoper in forum New To JavaReplies: 4Last Post: 12-24-2009, 04:41 PM -
Need Help on Remote Host Screen Capture
By krishnaraoveera1294 in forum AWT / SwingReplies: 4Last Post: 03-13-2009, 10:56 PM -
Unable to connect to MySQL on another (unix) host from Eclipse on my windows host
By kairamr in forum EclipseReplies: 0Last Post: 10-31-2008, 07:07 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks