Back to project page One-Button-App---Android.
The source code is released under:
Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (...
If you think the Android project One-Button-App---Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.cc.oba; //from w ww . ja v a2 s. c om import java.io.File; import java.util.Properties; import java.util.Vector; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.ChannelSftp.LsEntry; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; public class ConnectWithPass { public static void conn_do(String[] args) throws Exception { if (args.length < 3) { throw new Exception("not enough arguments"); } String serverUrl = args[0]; String userName = args[1]; String password = args[2]; JSch jsch = new JSch(); Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); config.put("compression.s2c", "zlib,none"); config.put("compression.c2s", "zlib,none"); Session session = jsch.getSession(userName, serverUrl); session.setConfig(config); session.setPort(22); session.setPassword(password); session.connect(); session.disconnect(); } }