Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Rep Power

    Default 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.

  2. #2
    FON is offline Senior 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 "" from
    Commons Net 2.0 API for this.


    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

    When you are done with keys you need to perform copying with SCP command using key created:

    Java Code:
    Process p = Runtime.getRuntime().exec(command);
    Where command is SCP command...

    - - -

    So describe what you will use
    so I can help you futher on this


Similar Threads

  1. Replies: 2
    Last Post: 03-04-2010, 11:33 AM
  2. Replies: 7
    Last Post: 02-24-2010, 08:00 PM
  3. copy file from local host to remote host
    By isotoper in forum New To Java
    Replies: 4
    Last Post: 12-24-2009, 04:41 PM
  4. Need Help on Remote Host Screen Capture
    By krishnaraoveera1294 in forum AWT / Swing
    Replies: 4
    Last Post: 03-13-2009, 10:56 PM
  5. Replies: 0
    Last Post: 10-31-2008, 07:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts