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

   * @param emailAddress Your email address as anon FTP password
   * @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

        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<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

    FileOutputStream out = null;
    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;
     
View Full Code Here

    boolean res = false;
    FTPClient client = new FTPClient();
    FileInputStream fis = null;

    try {
      client.connect(ftpUrl);
      if (debugMode)
        System.out.print(client.getReplyString());
      client.login(ftpLogin, ftpPass);
      if (debugMode)
        System.out.print(client.getReplyString());
View Full Code Here

  public boolean retrieveFromFTP() {
    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);
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.