I try using this code:
File wd = new File("/sx04a1/jakarta-tomcat-5/webapps/maltixa");
String sscp = "scp /sx04a1/jakarta-tomcat-5/webapps/maltixa/index.jsp
[email]jipbekok@fff04.ff.ff.es:/sx04a1/jakarta-tomcat-5/webapps/maltixa/index5.jsp[/email]";
p = Runtime.getRuntime().exec(sscp,null,wd);
try {
p.waitFor();
}
catch (InterruptedException e) {
e.printStackTrace();
}
out.println("Exit value: " + p.exitValue());
BufferedReader reader =new BufferedReader(new
InputStreamReader(p.getInputStream()));
String s = reader.readLine();
out.println("scp said [ " + s + " ]");
But the result is:
Exit value: 1 scp said [ null ]
I try with
String sscp = "scp index.jsp index4.jsp";
and the result is ok
I try too executing in a shell:
scp /sx04a1/jakarta-tomcat-5/webapps/maltixa/index.jsp
[email]jipbekok@fff04.ff.ff.es:/sx04a1/jakarta-tomcat-5/webapps/maltixa/index5.jsp[/email]
/sx04a1/jakarta-tomcat-5/webapps/maltixa
and the result is ok
I try giving all the permissions to the directory, and execute de .jsp
drwxrwxrwx 6 jipbekok jirxuxen 3072 Nov 24 11:59 maltixa
But the result is:
Exit value: 1 scp said [ null ]
Thanks for any comment