Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to connect to FTP server

Java: How to connect to FTP server
{filelink=9022}

import org.apache.commons.net.ftp.FTPClient;
import java.io.IOException;
public class FTPLogin
 {
  public static void main(String[] args) throws Exception
  	{
    FTPClient client_ftp = new FTPClient();
    client_ftp.connect("ftp.exemple.com");
    // try to connect using username and password
    boolean login = client_ftp.login("admin", "******");
    // check  the connection state
    if (login)
    {
      System.out.println("Successful");
    }
    	else
    {
      System.out.println("Failed");
    }
    client_ftp.disconnect();
  }
}

Users who found this page were searching for:

  • perl pop3 program
  • python enumerate dictionary
  • perl ftp download files
  • difference dates java
  • how to connect to FTP with Python
  • java receive datagram
  • javamail yahoo example
  • select rows table python
  • example of two swing jbuttons

No comments yet.

Leave a Comment