} if(found) {
else { throw new AuthenticationNotSupportedException(authCommand + " not supported by server (not listed in FEAT command)"); } } else {
    public void connect() throws NotConnectedException,IOException,AuthenticationNotSupportedException,FtpIOException,FtpWorkflowException {    	  socketProvider = new SocketProvider();          // Only for logging          String hostAndPort = getAddress().getHostName() + ":" + getAddress().getPort();          try          {              socketProvider.connect(getAddress(), getDownloadBandwidth(), getUploadBandwidth());              log.debug("connected to:" + hostAndPort);              socketProvider.socket().setSoTimeout(getTimeout());              socketProvider.socket().setKeepAlive(true);          }catch (IOException ioe)          {              String error = "Error connection to:" + hostAndPort;              log.error(error,ioe);              throw new NotConnectedException(error);          }          //Till here the connection is not encrypted!!          (ReplyWorker.readReply(socketProvider)).dumpReply();          Reply reply = sendCommand(new Command(Command.FEAT));                    String authCommand = getAuthString();          if(ReplyCode.isPositiveCompletionReply(reply))          {        	  List<String> lines = reply.getLines();        	  boolean found = false;                     	  for(String s : lines) {        		  if(s.indexOf(authCommand) > -1)        		  {                    authCommand = s;        			found = true;//        			break;                            		  } else if (s.indexOf(Command.SSCN) > -1) {                      setConnectionSSCNType(FTPConnection.SSCN_ON);                  }        	  }         	  if(found)        	  {                  negotiateAndLogin(authCommand);        	  }        	  else       		  {       			  throw new AuthenticationNotSupportedException(authCommand + " not supported by server (not listed in FEAT command)");       		  }          }          else          {              negotiateAndLogin(authCommand);          }                    this.setConnectionStatus(FTPConnection.CONNECTED);          fireConnectionStatusChanged(new FTPEvent(this, getConnectionStatus(), null));    }