Example usage for org.apache.commons.net.ftp FTPClient getReplyStrings

List of usage examples for org.apache.commons.net.ftp FTPClient getReplyStrings

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPClient getReplyStrings.

Prototype

public String[] getReplyStrings() 

Source Link

Document

Returns the lines of text from the last FTP server response as an array of strings, one entry per line.

Usage

From source file:com.geotrackin.gpslogger.senders.ftp.Ftp.java

private static void showServerReply(FTPClient client) {
    String[] replies = client.getReplyStrings();
    if (replies != null && replies.length > 0) {
        for (String aReply : replies) {
            tracer.debug("FTP SERVER: " + aReply);
        }//  w w  w  .j a v a2  s  .com
    }
}

From source file:com.claim.support.FtpUtil.java

public static void showServerReply(FTPClient ftpClient) {
    String[] replies = ftpClient.getReplyStrings();
    if (replies != null && replies.length > 0) {
        for (String aReply : replies) {
            System.out.println("SERVER STATUS CODE :: " + aReply);
            Console.LOG("SERVER STATUS CODE :: " + aReply, 1);
        }//from   ww w.ja  v a2 s  . com
    }
}

From source file:facturacion.ftp.FtpServer.java

private static void showServerReply(FTPClient ftpClient) {
    String[] replies = ftpClient.getReplyStrings();
    if (replies != null && replies.length > 0) {
        for (String aReply : replies) {
            System.out.println("SERVER: " + aReply);
        }/*from  w w  w  .j ava2 s .co m*/
    }
}

From source file:ddf.test.itests.catalog.TestFtp.java

private void showServerReply(FTPClient ftpClient) {
    String[] replies = ftpClient.getReplyStrings();
    if (replies != null && replies.length > 0) {
        for (String aReply : replies) {
            LOGGER.info("Server response: {}", aReply);
        }// www . j  a  v a2 s  .  c  o  m
    }
}

From source file:com.github.carlosrubio.org.apache.tools.ant.taskdefs.optional.net.FTP.java

/**
 * Sends a site command to the ftp server
 * @param ftp ftp client//  www . ja  v  a2s.c o  m
 * @param theCMD command to execute
 * @throws IOException  in unknown circumstances
 * @throws BuildException in unknown circumstances
 */
protected void doSiteCommand(FTPClient ftp, String theCMD) throws IOException, BuildException {
    boolean rc;
    String[] myReply = null;

    log("Doing Site Command: " + theCMD, Project.MSG_VERBOSE);

    rc = ftp.sendSiteCommand(theCMD);

    if (!rc) {
        log("Failed to issue Site Command: " + theCMD, Project.MSG_WARN);
    } else {

        myReply = ftp.getReplyStrings();

        for (int x = 0; x < myReply.length; x++) {
            if (myReply[x].indexOf("200") == -1) {
                log(myReply[x], Project.MSG_WARN);
            }
        }
    }
}

From source file:org.apache.tools.ant.taskdefs.optional.net.FTP.java

/**
 * Sends a site command to the ftp server
 * @param ftp ftp client//from w w  w . ja  v a2 s. c  om
 * @param theCMD command to execute
 * @throws IOException  in unknown circumstances
 * @throws BuildException in unknown circumstances
 */
protected void doSiteCommand(FTPClient ftp, String theCMD) throws IOException, BuildException {
    boolean rc;
    String[] myReply = null;

    log("Doing Site Command: " + theCMD, Project.MSG_VERBOSE);

    rc = ftp.sendSiteCommand(theCMD);

    if (!rc) {
        log("Failed to issue Site Command: " + theCMD, Project.MSG_WARN);
    } else {

        myReply = ftp.getReplyStrings();

        for (int x = 0; x < myReply.length; x++) {
            if (myReply[x] != null && myReply[x].indexOf("200") == -1) {
                log(myReply[x], Project.MSG_WARN);
            }
        }
    }
}

From source file:org.apache.tools.ant.taskdefs.optional.net.FTPTaskMirrorImpl.java

/**
 * Sends a site command to the ftp server
 * @param ftp ftp client/* w  w w  .  j  a  v  a  2 s .c  o m*/
 * @param theCMD command to execute
 * @throws IOException  in unknown circumstances
 * @throws BuildException in unknown circumstances
 */
protected void doSiteCommand(FTPClient ftp, String theCMD) throws IOException, BuildException {
    boolean rc;
    String[] myReply = null;

    task.log("Doing Site Command: " + theCMD, Project.MSG_VERBOSE);

    rc = ftp.sendSiteCommand(theCMD);

    if (!rc) {
        task.log("Failed to issue Site Command: " + theCMD, Project.MSG_WARN);
    } else {

        myReply = ftp.getReplyStrings();

        for (int x = 0; x < myReply.length; x++) {
            if (myReply[x].indexOf("200") == -1) {
                task.log(myReply[x], Project.MSG_WARN);
            }
        }
    }
}

From source file:ubicrypt.core.provider.ftp.FTProvider.java

private static String showServerReply(FTPClient ftpClient) {
    final String[] replyStrings = ftpClient.getReplyStrings();
    if (replyStrings != null) {
        return Arrays.stream(replyStrings).collect(Collectors.joining());
    }/*from w  w  w . j  a va2  s  .com*/
    return "";
}