PrivilegedAction a = new GetSystemPropertyAction("user.name");
PrivilegedAction a = new GetPropertyAction("user.name");
  public void connect()    throws IOException  {    if (connected)      {        return;      }    String host = url.getHost();    int port = url.getPort();    String username = url.getUserInfo();    String password = null;    if (username != null)      {        int ci = username.indexOf(':');        if (ci != -1)          {            password = username.substring(ci + 1);            username = username.substring(0, ci);          }      }    else      {        username = "anonymous";        PrivilegedAction a = new GetSystemPropertyAction("user.name");        String systemUsername =(String) AccessController.doPrivileged(a);        a = new GetLocalHostAction();        InetAddress localhost =(InetAddress) AccessController.doPrivileged(a);        password = systemUsername + "@" +          ((localhost == null) ? "localhost" : localhost.getHostName());      }    connection = new FTPConnection(host, port);    if (!connection.authenticate(username, password))      {        throw new SecurityException("Authentication failed");      }    connection.setPassive(passive);    if (representationType != -1)      {        connection.setRepresentationType(representationType);      }    if (fileStructure != -1)      {        connection.setFileStructure(fileStructure);      }    if (transferMode != -1)      {        connection.setTransferMode(transferMode);      }  }