Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.5k views
in Java FTP by (120 points)
Class FTPClient

public boolean site(String command)
throws IOException, FTPException {

checkConnection(true);

// send the retrieve command
FTPReply reply = control.sendCommand("SITE " + command);

// Can get a 200 (ok) or 202 (not impl). Some
// FTP servers return 502 (not impl)
String[] validCodes = {"200", "202", "502"};
lastValidReply = control.validateReply(reply, validCodes);

// return true or false? 200 is ok, 202/502 not
// implemented
if (reply.getReplyCode().equals("200"))
return true;
else
return false;
}
return :
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:11:35.171 : ---> SITE HELP
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:11:35.250 : 211 Valid SITE commands are: HELP, CHMOD, QUOTA, RETRBUFSIZE, STORBUFSIZE, SYMLINK, UMASK, UTIME.


public boolean site(String command)
throws IOException, FTPException {

checkConnection(true);

// send the retrieve command
FTPReply reply = control.sendCommand(command);

// Can get a 200 (ok) or 202 (not impl). Some
// FTP servers return 502 (not impl)
String[] validCodes = {"200", "202", "502"};
lastValidReply = control.validateReply(reply, validCodes);

// return true or false? 200 is ok, 202/502 not
// implemented
if (reply.getReplyCode().equals("200"))
return true;
else
return false;
}
return :
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.15 : ---> HELP
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.78 : 214-The following commands are recognized (* => unimplemented, + => extension).
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.343 : 214- ABOR CWD MKD OPTS+ REIN SITE STRU*
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.343 : 214- ACCT* DELE MLSD+ PASS REST SIZE SYST
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.343 : 214- ALLO* FEAT+ MLST+ PASV RETR SMNT* TYPE
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.343 : 214- APPE HELP MODE PORT RMD STAT USER
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.343 : 214- CDUP LIST NLST PWD RNFR STOR
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.343 : 214- CLNT+ MDTM NOOP QUIT RNTO STOU
DEBUG [com.net.ftp.FTPControlSocket] 27 Fev 2007 16:14:17.359 : 214
214 The following commands are recognized (* => unimplemented, + => extension). 214- ABOR CWD MKD OPTS+ REIN SITE STRU* 214- ACCT* DELE MLSD+ PASS REST SIZE SYST 214- ALLO* FEAT+ MLST+ PASV RETR SMNT* TYPE 214- APPE HELP MODE PORT RMD STAT USER 214- CDUP LIST NLST PWD RNFR STOR 214- CLNT+ MDTM NOOP QUIT RNTO STOU

1 Answer

0 votes
by (162k points)
Your SITE command seems to be returning 211.

Use setStrictReturnCodes(false) and you should be fine.

Categories

...