Package org.apache.commons.net.ftp

Examples of org.apache.commons.net.ftp.FTPClient.connect()


    FileOutputStream fos = null;
    FileInputStream fis = null;
    FTPClient client = null;
    try {
      client = new FTPClient();
      client.connect(ftpUrl);

      if (!client.login(ftpLogin, ftpPass))
        return false;

      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
View Full Code Here


        FTPClient ftp = new FTPClient();
        try {
            savedClient = ftp;
            final int port = getPortAsInt();
            if (port > 0){
                ftp.connect(getServer(),port);
            } else {
                ftp.connect(getServer());
            }
            res.latencyEnd();
            int reply = ftp.getReplyCode();
View Full Code Here

            savedClient = ftp;
            final int port = getPortAsInt();
            if (port > 0){
                ftp.connect(getServer(),port);
            } else {
                ftp.connect(getServer());
            }
            res.latencyEnd();
            int reply = ftp.getReplyCode();
            if (FTPReply.isPositiveCompletion(reply))
            {
View Full Code Here

        String connectUrl = url.getHost();
        int port = url.getPort() < 1 ? 21 : url.getPort();

        FTPClient ftp = new FTPClient();
        try {
          ftp.connect(connectUrl, port);
        } catch(ConnectException e) {
          throw new JMSException("Problem connecting the FTP-server");
        }
       
        if(!ftp.login(ftpUser, ftpPass)) {
View Full Code Here

        List<String> errorList = FastList.newInstance();

        FTPClient ftp = new FTPClient();
        try {
            Debug.logInfo("[putFile] connecting to: " + (String) context.get("hostname"), module);
            ftp.connect((String) context.get("hostname"));
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                Debug.logInfo("[putFile] Server refused connection", module);
                errorList.add("connection refused");
            } else {
                String username = (String) context.get("username");
View Full Code Here

        List<String> errorList = FastList.newInstance();

        FTPClient ftp = new FTPClient();
        try {
            ftp.connect((String) context.get("hostname"));
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                errorList.add("Server refused connection");
            } else {
                String username = (String) context.get("username");
                String password = (String) context.get("password");
View Full Code Here

        ftp2.addProtocolCommandListener(listener);

        try
        {
            int reply;
            ftp1.connect(server1);
            System.out.println("Connected to " + server1 + ".");

            reply = ftp1.getReplyCode();

            if (!FTPReply.isPositiveCompletion(reply))
View Full Code Here

        try {
            log("Opening FTP connection to " + server, Project.MSG_VERBOSE);

            ftp = new FTPClient();

            ftp.connect(server, port);
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                throw new BuildException("FTP connection failed: "
                     + ftp.getReplyString());
            }
View Full Code Here

        try
        {
            int reply;
            if (port1 > 0) {
                ftp1.connect(server1, port1);
            } else {
                ftp1.connect(server1);
            }
            System.out.println("Connected to " + server1 + ".");
View Full Code Here

        {
            int reply;
            if (port1 > 0) {
                ftp1.connect(server1, port1);
            } else {
                ftp1.connect(server1);
            }
            System.out.println("Connected to " + server1 + ".");

            reply = ftp1.getReplyCode();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.