Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.9k views
in Java FTP by (180 points)
Dear edtFTPj users.
I'm using FTPClient and trying to givea list command on a directory as follows -
String command = full ? "LIST ":"NLST ";
String reply = control.sendCommand(command + mask);

mask is "*.*" and full cab true or false.
Its returning a valid code 150.

Then I'm getting the inputreader as -
InputStreamReader in = new InputStreamReader(sock.getInputStream());
BufferedReader bIn = new BufferedReader(in);

After reading the output, I'm trying to validate the reply -
String[] validCodes2 = {"226", "250"};
reply = control.readReply();

here reply is 550, and this is giving an exception -
"No files found or invalid directory or permission problem"

What can be the problem, why does it return 550?
Please help.

Thanks in advance.
Best Regards
Shamik

4 Answers

0 votes
by (162k points)
Why don't you just use the dir() or dirDetails() commands?

Dear edtFTPj users.
I'm using FTPClient and trying to givea list command on a directory as follows -
String command = full ? "LIST ":"NLST ";
String reply = control.sendCommand(command + mask);

mask is "*.*" and full cab true or false.
Its returning a valid code 150.

Then I'm getting the inputreader as -
InputStreamReader in = new InputStreamReader(sock.getInputStream());
BufferedReader bIn = new BufferedReader(in);

After reading the output, I'm trying to validate the reply -
String[] validCodes2 = {"226", "250"};
reply = control.readReply();

here reply is 550, and this is giving an exception -
"No files found or invalid directory or permission problem"

What can be the problem, why does it return 550?
Please help.

Thanks in advance.
Best Regards
Shamik
0 votes
by
Hi,
The Library doesn't contain the dir() or ListDir() functions. Please provide me with the code for these functionalities.
Will be good if I get the latest functionalities added in the library.

Thanks in advance.
Regards
Shamik
0 votes
by (162k points)
It does - these methods have been there for many versions.

Download the latest here

http://www.enterprisedt.com/products/ed ... nload.html

Hi,
The Library doesn't contain the dir() or ListDir() functions. Please provide me with the code for these functionalities.
Will be good if I get the latest functionalities added in the library.

Thanks in advance.
Regards
Shamik
0 votes
by
Lots of thanks.
I was using a old library. I'll update this with the latest implementation.

Thanks again.
Regards
Shamik

Categories

...