shell - Running Unix command , after connecting through ftp using java -


i not authorized use ssh/sftp( using private/public key). ftp choice.

the following piece of code works fine me, fetching file unix box, motto log in unix box windows, using java,then home directory go different directory , use grep, copy output windows java program. looking how execute unix command in box. in shell/python/ant...

new url("ftp://user:password@url/sourcefile;type=i");             urlconnection con = url.openconnection();             bufferedinputstream in =                  new bufferedinputstream(con.getinputstream());             fileoutputstream out =                  new fileoutputstream("targetfile"); 

if have username , password can go jsch library.
have @ or directly run !!
http://www.jcraft.com/jsch/examples/shell.java.html


can shell commands this.


Comments