private FTPClient getFtpConnection (URL url) throws IOException {
        logger.entering(getClass().getName(), "getFtpConnection", url);

        String protocol = url.getProtocol();
        String host = url.getHost();
        String userInfo = url.getUserInfo();
        String path = url.getPath();

        String[] credentials = userInfo.split(":");

        FTPClient ftp = new FTPClient();
        ftp.connect(host);
        ftp.login(credentials[0], credentials[1]);
        int reply = ftp.getReplyCode();
        if (reply == FTPReply.NOT_LOGGED_IN) {
            try { ftp.disconnect(); ftp = null; } catch (Exception e) {}
            throw new IOException("Login failed on FTP host " + host + ".");
        }
        String sysName = ftp.getSystemName();
        System.err.println("FTP system is: " + sysName);
        boolean bStatus = ftp.changeToParentDirectory();
        bStatus = ftp.changeWorkingDirectory(path);
        if (!bStatus) {
            try { ftp.logout(); ftp.disconnect(); ftp = null; } catch (Exception e) {}
            throw new IOException("Changing working directory to " + path
                                    + " failed on FTP host " + host + ".");
        }
        if (props.getProperty("ftpPassiveMode", "false").equalsIgnoreCase("true")) {
            ftp.enterLocalPassiveMode();
        }
        if (!ftp.setFileType(FTP.BINARY_FILE_TYPE)) {
            try { ftp.logout(); ftp.disconnect(); ftp = null; } catch (Exception e) {}
            throw new IOException("Failed to set binary transfer mode.");
        }

        logger.exiting(getClass().getName(), "getFtpConnection");

        return ftp;
    }