public sun.net.ftp.FtpClient login(String user,char[] password) throws sun.net.ftp.FtpProtocolException, IOException {
  if (!isConnected()) {
    throw new sun.net.ftp.FtpProtocolException("Not connected yet",FtpReplyCode.BAD_SEQUENCE);
  }
  if (user == null || user.length() == 0) {
    throw new IllegalArgumentException("User name can't be null or empty");
  }
  tryLogin(user,password);
  String l;
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < serverResponse.size(); i++) {
    l=serverResponse.elementAt(i);
    if (l != null) {
      if (l.length() >= 4 && l.startsWith("230")) {
        l=l.substring(4);
      }
      sb.append(l);
    }
  }
  welcomeMsg=sb.toString();
  loggedIn=true;
  return this;
}

public sun . net . ftp . FtpClient login ( String user , char [ ] password ) throws sun . net . ftp . FtpProtocolException , IOException { if ( ! isConnected ( ) ) { throw new sun . net . ftp . FtpProtocolException ( "Not connected yet" , FtpReplyCode . BAD_SEQUENCE ) ; } if ( user == null || user . length ( ) == 0 ) { throw new IllegalArgumentException ( "User name can't be null or empty" ) ; } tryLogin ( user , password ) ; String l ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < serverResponse . size ( ) ; i ++ ) { l = serverResponse . elementAt ( i ) ; if ( l != null ) { if ( l . length ( ) >= 4 && l . startsWith ( "230" ) ) { l = l . substring ( 4 ) ; } sb . append ( l ) ; } } welcomeMsg = sb . toString ( ) ; loggedIn = true ; return this ; }
attempts to log on the server with the specified user name and password .
