Package org.apache.commons.net.ftp

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


            }
            res.latencyEnd();
            int reply = ftp.getReplyCode();
            if (FTPReply.isPositiveCompletion(reply))
            {
                if (ftp.login( getUsername(), getPassword())){
                    if (binaryTransfer) {
                        ftp.setFileType(FTP.BINARY_FILE_TYPE);
                    }
                    ftp.enterLocalPassiveMode();// should probably come from the setup dialog
                    boolean ftpOK=false;
View Full Code Here


            }
            res.latencyEnd();
            int reply = ftp.getReplyCode();
            if (FTPReply.isPositiveCompletion(reply))
            {
                if (ftp.login( getUsername(), getPassword())){
                    if (binaryTransfer) {
                        ftp.setFileType(FTP.BINARY_FILE_TYPE);
                    }
                    ftp.enterLocalPassiveMode();// should probably come from the setup dialog
                    boolean ftpOK=false;
View Full Code Here

   * @param inCambridge Whether you can use the Cambridge HTTP/FTP proxy
   */
  public void fetchFromPubChem(String emailAddress, boolean inCambridge) throws Exception {
    FTPClient ftpc = new FTPClient();
    ftpc.connect("ftp.ncbi.nlm.nih.gov");
    ftpc.login("anonymous", emailAddress);
    ftpc.changeWorkingDirectory("/pubchem/Compound/CURRENT-Full/SDF/");
   
    String [] names = ftpc.listNames();
    ftpc.disconnect();
   
View Full Code Here

            }
            res.latencyEnd();
            int reply = ftp.getReplyCode();
            if (FTPReply.isPositiveCompletion(reply))
            {
                if (ftp.login( getUsername(), getPassword())){
                    if (binaryTransfer) {
                        ftp.setFileType(FTP.BINARY_FILE_TYPE);
                    }
                    ftp.enterLocalPassiveMode();// should probably come from the setup dialog
                    boolean ftpOK=false;
View Full Code Here

        int code = ftp.getReplyCode();
        if (!FTPReply.isPositiveCompletion(code)) {
            ftp.disconnect();
            throw new ConnectionRefusedException(code);
        }
        if (!ftp.login(getUsername(), getPassword())) {
            ftp.disconnect();
            throw new ConnectionRefusedException(ftp.getReplyCode());
        }
        if (isBinaryMode()) {
            ftp.setFileType(FTP.BINARY_FILE_TYPE);
View Full Code Here

                errorList.add("connection refused");
            } else {
                String username = (String) context.get("username");
                String password = (String) context.get("password");
                Debug.logInfo("[putFile] logging in: username=" + username + ", password=" + password, module);
                if (!ftp.login(username, password)) {
                    Debug.logInfo("[putFile] login failed", module);
                    errorList.add("Login failed (" + username + ", " + password + ")");
                } else {
                    Boolean binaryTransfer = (Boolean) context.get("binaryTransfer");
                    boolean binary = (binaryTransfer == null) ? false : binaryTransfer.booleanValue();
View Full Code Here

                errorList.add("Server refused connection");
            } else {
                String username = (String) context.get("username");
                String password = (String) context.get("password");

                if (!ftp.login(username, password)) {
                    errorList.add("Login failed (" + username + ", " + password + ")");
                } else {
                    Boolean binaryTransfer = (Boolean) context.get("binaryTransfer");
                    boolean binary = (binaryTransfer == null) ? false : binaryTransfer.booleanValue();
                    if (binary) { ftp.setFileType(FTP.BINARY_FILE_TYPE); }
View Full Code Here

    FileInputStream in = null;

    FTPClient client = new FTPClient();
    try {
      client.connect(ftpUrl);
      if (!client.login(ftpLogin, ftpPass))
        return false;
      if (!FTPReply.isPositiveCompletion(client.getReplyCode()))
        return false;
     
      client.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
View Full Code Here

    try {
      client.connect(ftpUrl);
      if (debugMode)
        System.out.print(client.getReplyString());
      client.login(ftpLogin, ftpPass);
      if (debugMode)
        System.out.print(client.getReplyString());
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
View Full Code Here

    boolean res = false;
    FTPClient client = new FTPClient();
    FileOutputStream fos = null;
    try {
      client.connect(ftpUrl);
      client.login(ftpLogin, ftpPass);
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
      client.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
      client.changeWorkingDirectory("Flibus");
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.