Package org.apache.commons.net.ftp

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


        String[] pathes = getPath().replaceAll("\\\\", "/").split("/");
        boolean find = false;
        if (pathes.length > 0) {
            for (int i = 0; i < pathes.length - 1; i++){
                log.trace("Ftp client: we at: " + client.printWorkingDirectory() + ", go to \'" + pathes[i] + "'");
                int reply = client.cwd(pathes[i]);
                if (reply >= 400) {
                    log.warn("exist cwd " + pathes[i] + " responce code : " + client.getReplyCode() + ", reply: " + client.getReplyString());
                    return false;
                }
                log.trace("exist responce code : " + client.getReplyCode() + ", reply: " + client.getReplyString());
View Full Code Here


    // TODO: put in constants size is 2GB
    if (file.length() > connectionManager.getConfig().getFtpFileSize()) {
      FTPClient ftp = null;
      try {
        ftp = connectionManager.getFTP();
        ftp.cwd(connectionManager.getConfig().getFtpDir());
        ftp.enterLocalPassiveMode();
        if (!ftp.storeFile(file.getName(), new FileInputStream(file))) {
          throw new FTPException("Error during FTP store file.");
        }
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.