Examples of FTPReply


Examples of htsjdk.samtools.util.ftp.FTPReply

        }

        int n = 0;
        try {

            FTPReply reply = ftp.pasv();
            assertTrue(reply.isSuccess());

            if (position > 0) ftp.setRestPosition(position);

            reply = ftp.retr(path);
            //assertTrue(reply.getCode() == 150);
View Full Code Here

Examples of htsjdk.samtools.util.ftp.FTPReply

                URL url = new URL(path);
                if (path.startsWith("ftp:")) {
                    String host = url.getHost();
                    FTPClient ftp = FTPUtils.connect(host, url.getUserInfo(), new UserPasswordInputImpl());
                    ftp.pasv();
                    FTPReply reply = ftp.executeCommand("MDTM " + url.getPath());
                    resp = reply.getReplyString();
                    return ftpDateFormat.parse(resp).getTime();
                } else {
                    return HttpUtils.getInstance().getLastModified(url);
                }
View Full Code Here

Examples of it.sauronsoftware.ftp4j.FTPReply

      throws IOException {
    Socket socket = new Socket(proxyHost, proxyPort);
    FTPCommunicationChannel communication = new FTPCommunicationChannel(
        socket, "ASCII");
    // Welcome message.
    FTPReply r;
    try {
      r = communication.readFTPReply();
    } catch (FTPIllegalReplyException e) {
      throw new IOException("Invalid proxy response");
    }
    // Does this reply mean "ok"?
    if (r.getCode() != 220) {
      // Mmmmm... it seems no!
      throw new IOException("Invalid proxy response");
    }
    if (style == STYLE_SITE_COMMAND) {
      // Usefull flags.
      boolean passwordRequired;
      // Send the user and read the reply.
      communication.sendFTPCommand("USER " + proxyUser);
      try {
        r = communication.readFTPReply();
      } catch (FTPIllegalReplyException e) {
        throw new IOException("Invalid proxy response");
      }
      switch (r.getCode()) {
      case 230:
        // Password isn't required.
        passwordRequired = false;
        break;
      case 331:
        // Password is required.
        passwordRequired = true;
        break;
      default:
        // User validation failed.
        throw new IOException("Proxy authentication failed");
      }
      // Password.
      if (passwordRequired) {
        // Send the password.
        communication.sendFTPCommand("PASS " + proxyPass);
        try {
          r = communication.readFTPReply();
        } catch (FTPIllegalReplyException e) {
          throw new IOException("Invalid proxy response");
        }
        if (r.getCode() != 230) {
          // Authentication failed.
          throw new IOException("Proxy authentication failed");
        }
      }
      communication.sendFTPCommand("SITE " + host + ":" + port);
View Full Code Here

Examples of it.sauronsoftware.ftp4j.FTPReply

      throws IOException {
    Socket socket = new Socket(proxyHost, proxyPort);
    FTPCommunicationChannel communication = new FTPCommunicationChannel(
        socket, "ASCII");
    // Welcome message.
    FTPReply r;
    try {
      r = communication.readFTPReply();
    } catch (FTPIllegalReplyException e) {
      throw new IOException("Invalid proxy response");
    }
    // Does this reply mean "ok"?
    if (r.getCode() != 220) {
      // Mmmmm... it seems no!
      throw new IOException("Invalid proxy response");
    }
    if (style == STYLE_SITE_COMMAND) {
      // Usefull flags.
      boolean passwordRequired;
      // Send the user and read the reply.
      communication.sendFTPCommand("USER " + proxyUser);
      try {
        r = communication.readFTPReply();
      } catch (FTPIllegalReplyException e) {
        throw new IOException("Invalid proxy response");
      }
      switch (r.getCode()) {
      case 230:
        // Password isn't required.
        passwordRequired = false;
        break;
      case 331:
        // Password is required.
        passwordRequired = true;
        break;
      default:
        // User validation failed.
        throw new IOException("Proxy authentication failed");
      }
      // Password.
      if (passwordRequired) {
        // Send the password.
        communication.sendFTPCommand("PASS " + proxyPass);
        try {
          r = communication.readFTPReply();
        } catch (FTPIllegalReplyException e) {
          throw new IOException("Invalid proxy response");
        }
        if (r.getCode() != 230) {
          // Authentication failed.
          throw new IOException("Proxy authentication failed");
        }
      }
      communication.sendFTPCommand("SITE " + host + ":" + port);
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.