by Rashmi » Wed Jul 21, 2010 8:10 pm
Hi
I get an error as below when I include the ccc() command in my code. Not sure what I'm doing wrong?
FTPException caught connecting to localhost:21 (FTPThread.java-527)
com.enterprisedt.net.ftp.FTPException: 500 Syntax error, command unrecognized.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(Unknown Source)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.ccc(Unknown Source)
at com.cypherit.bbrad.server.jobs.FTPThread.initialiseFTPConnection(FTPThread.java:483)
at com.cypherit.bbrad.server.jobs.FTPThread.run(FTPThread.java:667)
Code snippet where I have included the ccc() command:
ftp = new SSLFTPClient();
messageCollector = new FTPMessageCollector();
ftp.setMessageListener(messageCollector); // ensure that we get logging
ftp.setRemoteHost( recipientHost.getHostName() );
/* Set the timeout, if no timeout is specified in the ini file
* then set the timeout to 30 seconds
*/
if (bbRadConfig.getFTPTimeout() != -1)
ftp.setTimeout(bbRadConfig.getFTPTimeout());
else
ftp.setTimeout(30000);
ftp.setRemotePort( controlPort );
/*
* Validate server.
* The validator assumes commonName is set as hostname and validation fails
* if this does not match. You have to force the validator to check for a different
* commonName by passing the commonName variable.
*/
ftp.setValidateServer(false); // you can skip server validation by setting it to false. Default is true
if(commonName != null && !commonName.equals(""))
ftp.setCustomValidator(new SSLFTPStandardValidator(commonName));
ftp.getRootCertificateStore().importPEMFile(certificateFile);
ftp.connect();
ftp.auth(SSLFTPClient.AUTH_TLS);
if(!recipientHost.getProtocol().equals(RecipientHost.PROTOCOL_SSLTLSFTP))
{
ftp.ccc();
}
Thanks
Rashmi