List of usage examples for org.apache.commons.net.ftp FTPClient connect
public void connect(InetAddress host) throws SocketException, IOException
From source file:vv.main.java
private void btnBackupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackupActionPerformed // TODO add your handling code here: Conectar con = new Conectar(); String nombreCarpeta = "FTF_" + con.getTime("dd-MM-yyyy") + "_" + con.getTime("HHmm"); con.createDir("c:\\tmp\\" + nombreCarpeta); FTPClient client = new FTPClient(); String sFTP = con.IP_FTP;/* w ww .jav a 2 s. c o m*/ String sUser = con.USUARIO_FTP; String sPassword = con.PASSWORD_FTP; txtLog.setText("INICIO: " + con.getTime("dd-MM-yyyy HH:mm:ss")); try { client.connect(sFTP); boolean login = client.login(sUser, sPassword); con.copiarDir(client, nombreCarpeta); client.logout(); client.disconnect(); } catch (Exception e) { System.out.println("Error:" + e); } txtLog.setText(txtLog.getText() + "\nFIN: " + con.getTime("dd-MM-yyyy HH:mm:ss")); }