Class HostPort

java.lang.Object
org.globus.ftp.HostPort
Direct Known Subclasses:
HostPort6

public class HostPort extends Object
Utility class for parsing and converting host-port information from PASV and PORT ftp commands.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
    HostPort(String passiveReplyMessage)
    Parses host-port from passive mode reply message.
     
    HostPort(String ipAddress, int port)
    Creates the HostPort object from specified ip address and port number.
     
    HostPort(InetAddress addr, int port)
    Creates the HostPort object from specified ip address and port number.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the ip address in the form "h1.h2.h3.h4"
    int
    Returns the port number
    Returns the host-port information in the format used by PORT command.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • datainfo

      private int[] datainfo
  • Constructor Details

    • HostPort

      protected HostPort()
    • HostPort

      public HostPort(String passiveReplyMessage)
      Parses host-port from passive mode reply message. Note that the argument is not the whole message, but only the content of the brackets: h1,h2,h3,h4,p1,p2
      Parameters:
      passiveReplyMessage - reply message for the PASV command
    • HostPort

      public HostPort(InetAddress addr, int port)
      Creates the HostPort object from specified ip address and port number.
      Parameters:
      addr - ip address
      port - port number
    • HostPort

      public HostPort(String ipAddress, int port)
      Creates the HostPort object from specified ip address and port number.
      Parameters:
      ipAddress - ip address
      port - port number
  • Method Details

    • getPort

      public int getPort()
      Returns the port number
      Returns:
      port number
    • getHost

      public String getHost()
      Returns the ip address in the form "h1.h2.h3.h4"
      Returns:
      ip address
    • toFtpCmdArgument

      public String toFtpCmdArgument()
      Returns the host-port information in the format used by PORT command. (h1,h2,h3,h4,p1,p2)
      Returns:
      host-port information in PORT command representation.