ftp list 空 java,ftpclient listfiles为空解析(Ftpclient listfiles is empty parsing).doc

ftpclient listfiles为空解析(Ftpclient listfiles is empty parsing)

ftpclient listfiles为空解析(Ftpclient listfiles is empty parsing)

In the package FTPClient. ListFiles () method returns null problem and its solution < /wodong/archive/2008/08/21/wodong.html >

The project currently being developed requires downloading data from the remote server and using the open source .ftp package. A problem is found in the actual application, and the ftpclient.listfiles () method can be called on the test server to return an array containing the filename, and this method returns NULL on the current network server. I have been baffled by this question for a long time, and here are my thoughts on the following:

(1) firstly, the difference between the two servers is found: the test server is solaris server, and the current network server is the HP server. Can it be caused by the platform difference? With this problem, download the source code for the common package and debug it through source code.

(2) FTPListParseEngine handles the processing of information from a socket to obtain a remote server. I've probably done ls minus l

Manipulate, and put the results in a linkedlist. The code is as follows:

1private void readStream (InputStream stream, String encoding) throws IOException

2 {

3 BufferedReader reader;

4 if (encoding = = null)

5 {

6 reader = new BufferedReader (stream)

7}

8 the else

9 {

10 reader = new BufferedReader (stream, encoding);

11}

12

13 the String line = this. Parser. ReadNextEntry (reader);

14

15 while (line! = null)

16 {

17 this. Entries. The add (line);

18 the line = this. Parser. ReadNextEntry (reader);

19}

20 reader. The close ();

21}

22

(3) at this time, the problem is found, and the string in the line is in chaos! Normal should be:

Drwxr-xr-x 11 daladmin daladmin 1024 September 18, 2004 MQM

Time is a mess.

(4) : in the call listFiles () before calling ftpClient. SetControlEncoding (" GBK "); This line will display normally, but the listFiles () return is still empty!!! Continue to...

(5) it is found that a regular expression mat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值