英特內軟體股份有限公司


jcx.net
Class telnet

java.lang.Object
  |
  +--jcx.net.telnet
All Implemented Interfaces:
java.lang.Runnable

public class telnet
extends java.lang.Object
implements java.lang.Runnable

此類別 telnet 為一 telnet API, 凡是欲連結 telnet 皆可引用此 API 。


Constructor Summary
telnet()
           
 
Method Summary
 void close()
          Close telnet session
 java.lang.String getResponse()
          send command to server.
static void main(java.lang.String[] args)
           
 boolean open(java.lang.String host)
          open conection to telnet server.
 boolean open(java.lang.String host, java.lang.String id, java.lang.String pwd)
          open conection to telnet server.
 void run()
           
 void send(java.lang.String cmd)
          send command to server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

telnet

public telnet()
Method Detail

getResponse

public java.lang.String getResponse()
send command to server.
Parameters:
none -  
Returns:
latest telnet console message

send

public void send(java.lang.String cmd)
          throws java.io.IOException
send command to server.
Parameters:
cmd - cmd to be send, Ex: ls ,df.
Throws:
java.io.IOException - if error

open

public boolean open(java.lang.String host)
             throws java.io.IOException
open conection to telnet server.
Parameters:
host - Host to be connected.
Throws:
java.io.IOException - if login error

open

public boolean open(java.lang.String host,
                    java.lang.String id,
                    java.lang.String pwd)
             throws java.io.IOException
open conection to telnet server.
Parameters:
host - Host to be connected.
id - telnet login ID (override constructor ID).
pwd - telnet login PASSWORD (override constructor PWD).
Throws:
java.io.IOException - if login error

run

public void run()
Specified by:
run in interface java.lang.Runnable

close

public void close()
Close telnet session
Returns:
none.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException

英特內軟體股份有限公司