jbackup/src/main/java/org/jbundle/jbackup/destination/FtpDestination.java
public void initTransfer(Properties properties)
	{
		super.initTransfer(properties);
		FTPClient client = new FTPClient();
		if (DEBUG)
			System.out.println("Connecting");
		String strHost = properties.getProperty(FTP_HOST, "hd2-12.irv.zyan.com");
		String strPort = properties.getProperty(FTP_PORT, "21");
		int port = Integer.parseInt(strPort);
		String strUsername = properties.getProperty(USER_NAME, "anonymous");
		String strPassword = properties.getProperty(PASSWORD, "doncorley@zyan.com");
		m_strRootFTPDirectory = properties.getProperty(ROOT_DIR, DEFAULT_ROOT_DIR);
		if (m_strRootFTPDirectory.endsWith("/"))
			m_strRootFTPDirectory = m_strRootFTPDirectory.substring(0, m_strRootFTPDirectory.length() - 1);
		if (m_strRootFTPDirectory.startsWith("/"))
			m_strRootFTPDirectory = m_strRootFTPDirectory.substring(1);
	 	properties.setProperty(FTP_HOST, strHost);
	 	properties.setProperty(USER_NAME, strUsername);
	 	properties.setProperty(PASSWORD, strPassword);
	 	properties.setProperty(ROOT_DIR, m_strRootFTPDirectory);
	    try {
		 	client.connect(strHost, port);
			if (DEBUG)
				System.out.println("Connected to " + strHost + ".");
	
		      // After connection attempt, you should check the reply code to verify
		      // success.
		    int reply = client.getReplyCode();
			if(FTPReply.isPositiveCompletion(reply))
			{
					client.login(strUsername, strPassword);
					client.enterLocalPassiveMode();
					m_client = client;	// Flag success
			}
			else
			{ // Error
				if (DEBUG)
					System.out.println("FTP connect Error: " + reply);
				client.disconnect();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
public void initTransfer(Properties properties)
	{
		super.initTransfer(properties);
		FTPClient client = new FTPClient();
		if (DEBUG)
			System.out.println("Connecting");
		String strHost = properties.getProperty(FTP_HOST, "hd2-12.irv.zyan.com");
		String strPort = properties.getProperty(FTP_PORT, "21");
		int port = Integer.parseInt(strPort);
		String strUsername = properties.getProperty(USER_NAME, "anonymous");
		String strPassword = properties.getProperty(PASSWORD, "doncorley@zyan.com");
		m_strRootFTPDirectory = properties.getProperty(ROOT_DIR, DEFAULT_ROOT_DIR);
		if (m_strRootFTPDirectory.endsWith("/"))
			m_strRootFTPDirectory = m_strRootFTPDirectory.substring(0, m_strRootFTPDirectory.length() - 1);
		if (m_strRootFTPDirectory.startsWith("/"))
			m_strRootFTPDirectory = m_strRootFTPDirectory.substring(1);
	 	properties.setProperty(FTP_HOST, strHost);
	 	properties.setProperty(USER_NAME, strUsername);
	 	properties.setProperty(PASSWORD, strPassword);
	 	properties.setProperty(ROOT_DIR, m_strRootFTPDirectory);
	    try {
		 	client.connect(strHost, port);
			if (DEBUG)
				System.out.println("Connected to " + strHost + ".");
	
		      // After connection attempt, you should check the reply code to verify
		      // success.
		    int reply = client.getReplyCode();
			if(FTPReply.isPositiveCompletion(reply))
			{
					client.login(strUsername, strPassword);
					client.enterLocalPassiveMode();
					m_client = client;	// Flag success
			}
			else
			{ // Error
				if (DEBUG)
					System.out.println("FTP connect Error: " + reply);
				client.disconnect();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
public void initTransfer ( Properties properties ) { super . initTransfer ( properties ) ; FTPClient client = new FTPClient ( ) ; if ( DEBUG ) System . out . println ( "Connecting" ) ; String strHost = properties . getProperty ( FTP_HOST , "hd2-12.irv.zyan.com" ) ; String strPort = properties . getProperty ( FTP_PORT , "21" ) ; int port = Integer . parseInt ( strPort ) ; String strUsername = properties . getProperty ( USER_NAME , "anonymous" ) ; String strPassword = properties . getProperty ( PASSWORD , "doncorley@zyan.com" ) ; m_strRootFTPDirectory = properties . getProperty ( ROOT_DIR , DEFAULT_ROOT_DIR ) ; if ( m_strRootFTPDirectory . endsWith ( "/" ) ) m_strRootFTPDirectory = m_strRootFTPDirectory . substring ( 0 , m_strRootFTPDirectory . length ( ) - 1 ) ; if ( m_strRootFTPDirectory . startsWith ( "/" ) ) m_strRootFTPDirectory = m_strRootFTPDirectory . substring ( 1 ) ; properties . setProperty ( FTP_HOST , strHost ) ; properties . setProperty ( USER_NAME , strUsername ) ; properties . setProperty ( PASSWORD , strPassword ) ; properties . setProperty ( ROOT_DIR , m_strRootFTPDirectory ) ; try { client . connect ( strHost , port ) ; if ( DEBUG ) System . out . println ( "Connected to " + strHost + "." ) ; // After connection attempt, you should check the reply code to verify // success. int reply = client . getReplyCode ( ) ; if ( FTPReply . isPositiveCompletion ( reply ) ) { client . login ( strUsername , strPassword ) ; client . enterLocalPassiveMode ( ) ; m_client = client ; // Flag success } else { // Error if ( DEBUG ) System . out . println ( "FTP connect Error: " + reply ) ; client . disconnect ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } }
/*
Set up everything to start processing
/ * Set up everything to start processing