Is there an open source telnet API/library out there for Java (something like Python telnetlib)? I need to connect to a server using telnet and execute some commands from within a Java program.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
My preference is to use the Apache Commons-Net library. http://commons.apache.org/net/ It supports many client protocols, including Telnet.
I've used this in the past and it works quite well.
回答2:
Maybe is worth considering using SSH protocol, instead of Telnet. Telnet is much less secure, for instance all the data is transmitted as plain text (including your passwords).
回答3:
Sure is.
http://sourceforge.net/projects/jtelnet/ (EDIT: Noted as crap.)
Here is an Apache project which is presumably much more handy:
http://commons.apache.org/net/