首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

common-net ftp打包

2012-09-22 
common-netftp封装?好像这个版本的不支持设置连接超时,所以重写了个? class FTPClient extends org.apache

common-net ftp封装

?

好像这个版本的不支持设置连接超时,所以重写了个

?

 class FTPClient extends org.apache.commons.net.ftp.FTPClient{private SocketFactory _socketFactory_=SocketFactory.getDefault();private int timeOut = 2000;public FTPClient(){}    public void connect(InetAddress host, int port)    throws SocketException, IOException    {    _socket_=this._socketFactory_.createSocket();        _socket_.connect(new InetSocketAddress(host, port), timeOut);        _connectAction_();    }    public void connect(String hostname, int port)    throws SocketException, IOException    {        connect(InetAddress.getByName(hostname), port);    }    public void setConnTimeOut(int timeOut){        }public int getTimeOut() {return timeOut;}public void setTimeOut(int timeOut) {this.timeOut = timeOut;}}

?

热点排行