Results 1 to 2 of 2

Thread: Scp problem

  1. #1
    lacoo2004 is offline Member
    Join Date
    Apr 2010
    Posts
    1
    Rep Power
    0

    Default Scp problem

    Hello everybody!

    I would like to copy a file to a remote server with this code:

    package safecopy;
    import org.apache.tools.ant.taskdefs.optional.ssh.Scp;
    import org.apache.tools.ant.Task;
    public class Main {
    public static void main(String[] args) {
    Scp scp = new Scp();
    scp.setFile("c:/Temp/szamok.java");
    scp.setTodir("usr:psw@hallg.inf.unideb.hu:/home/usr");
    scp.init();
    scp.execute();
    }
    }

    But I get an exception when I run that program:
    Exception in thread "main" Exactly one of [todir|localtodir|remotetodir|localtofile|remotetof ile] is required.

    I used this api: Scp (Apache Ant API)

    What is the problem about this code?

    Thanks for help!

  2. #2
    mjawwad is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default

    Hi,
    Is there any stack-trace exceptions that can be analyzed?

    You might be interested in using this SCP component :

    Secure iNet Factory User GuideUsing SCP

Posting Permissions

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