Results 1 to 2 of 2
Thread: Scp problem
- 04-27-2010, 11:11 AM #1
Member
- Join Date
- Apr 2010
- Posts
- 1
- Rep Power
- 0
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!
- 05-31-2010, 10:40 PM #2
Member
- Join Date
- May 2010
- Posts
- 4
- Rep Power
- 0
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


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks