I am making a class that will use ftp to put files on a remote server. I can connect to the server with no problem and run the help command but when I try to run the list command I get an error message
220 FTP Server ready. 331 Password required for u35670060. 230 User u35670060 logged in. 214-The following commands are recognized (* =>'s unimplemented). USER PASS ACCT* CWD XCWD CDUP XCUP SMNT* QUIT REIN* PORT PASV TYPE STRU MODE RETR STOR STOU APPE ALLO* REST RNFR RNTO ABOR DELE MDTM RMD XRMD MKD XMKD PWD XPWD SIZE LIST NLST SITE SYST STAT HELP NOOP FEAT OPTS ADAT* AUTH* CCC* CONF* ENC* MIC* PBSZ* PROT* 214 Direct comments to your support help desk. 257 "/" is current directory. 425 Unable to build data connection: Connection refused
checked the web and found that it may be a problem with my socket connection below is the code.
Unless this is just an exercise, why are you reinventing the wheel by writing your own java FTP client? There are a number of open source Java clients availabe, as well as some API right within the JDK for accessing FTP servers.
Here's an article in Java World that explores some of the options.
Back to the original question: I suspect that the buffer containing information coming back from the server may be filling up before you read it. I'd suggest putting code to read the response after each command sent.