mina-ftpserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gary.b...@aero.bombardier.com
Subject Re: Enrich error messages
Date Fri, 25 Jun 2010 07:36:37 GMT
Here is a snippet from my code that does something similar.
------------------------------
public FtpletResult onUploadStart(FtpSession session, FtpRequest request)
throws FtpException, IOException {

            if (isExternalInterface(session) && !
isSecureConnection(session)) {
                  //security issue, either the control or data port is
unsecure
                  LOG.error("About to start an upload, but either the
control or data connection is unsecure. Upload aborted.");
                  FtpReply reply = new DefaultFtpReply(FtpReply.
REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "Session is not secure. Issue PROT P
command first.);
                  session.write(reply);
                  return FtpletResult.SKIP;
            }
            return super.onUploadStart(session, request);
}


Best Regards,
Gary Bell.


Mime
View raw message