Package org.apache.commons.net.ftp

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


        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

        List errorList = new ArrayList();

        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 errorList = new ArrayList();

        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

    //Argument ASC_ID
   
    FTPClient client = new FTPClient();
    FileOutputStream fos = null;
    try {
      client.connect("your_FTP_IP");//change
      client.login("user", "password"); //change
     
     
      //DEPENDS ON NAMING CONVENTION
      String filename = "ASC_Description"+ASC_ID+".xml";
View Full Code Here

    //Argument ASC_ID
   
    FTPClient client = new FTPClient();
    FileInputStream fis = null;
    try {
      client.connect("your_FTP_IP");
      client.login("user", "password");
     
     
      //DEPENDS ON NAMING CONVENTION for the models-here ANNs were used so it is netASC_ID.m
      String filename = "net"+ASC_ID+".m";
View Full Code Here

        LOG.info("Opening FTP connection to " + targetHost);

        FTPClient ftp = new FTPClient();

        try {
            ftp.connect(targetHost, targetPort);
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                throw new CruiseControlException("FTP connection failed: "
                     + ftp.getReplyString());
            }
   
View Full Code Here

        LOG.info("Opening FTP connection to " + targetHost);

        FTPClient ftp = new FTPClient();

        try {
            ftp.connect(targetHost, targetPort);
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                throw new CruiseControlException("FTP connection failed: "
                     + ftp.getReplyString());
            }
   
View Full Code Here

                                           new PrintWriter(System.out)));

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

            // After connection attempt, you should check the reply code to verify
            // success.
            reply = ftp.getReplyCode();
View Full Code Here

        try {
            client1.connect("localhost", getListenerPort());
            client2.connect("localhost", getListenerPort());
            client3.connect("localhost", getListenerPort());
            client4.connect("localhost", getListenerPort());

            assertTrue(client1.login(TESTUSER1_USERNAME, TESTUSER_PASSWORD));
            assertTrue(client2.login(TESTUSER1_USERNAME, TESTUSER_PASSWORD));
            assertTrue(client3.login(TESTUSER1_USERNAME, TESTUSER_PASSWORD));
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.