HostPort (Java Globus API)

org.globus.io.ftp
Class HostPort

java.lang.Object
  |
  +--org.globus.io.ftp.HostPort

public class HostPort
extends java.lang.Object

This class is a utility class for parsing and converting host-port information from PASV and PORT ftp commands.


Constructor Summary
HostPort(java.net.InetAddress addr, int port)
          Creates the HostPort object from specified ip address and port number.
HostPort(java.lang.String passiveReply)
          Parses host-port from passive mode reply (x,x,x,x,p1,p2)
HostPort(java.lang.String ipAddress, int port)
          Creates the HostPort object from specified ip address and port number.
 
Method Summary
 java.lang.String getHost()
          Returns the ip address.
 int getPort()
          Returns the port number
 java.lang.String toPortCmdFormat()
          Returns the host-port infromation 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
 

Constructor Detail

HostPort

public HostPort(java.lang.String passiveReply)
Parses host-port from passive mode reply (x,x,x,x,p1,p2)

Parameters:
passiveReply - reply from the PASV command

HostPort

public HostPort(java.net.InetAddress addr,
                int port)
Creates the HostPort object from specified ip address and port number. (It converts it to the internal representation used for PORT command)

Parameters:
addr - ip address
port - port number

HostPort

public HostPort(java.lang.String ipAddress,
                int port)
Creates the HostPort object from specified ip address and port number. (It converts it to the internal representation used for PORT command)

Parameters:
port - port number
Method Detail

getPort

public int getPort()
Returns the port number

Returns:
port number

getHost

public java.lang.String getHost()
Returns the ip address.

Returns:
ip address

toPortCmdFormat

public java.lang.String toPortCmdFormat()
Returns the host-port infromation in the format used by PORT command. (h1,h2,h3,h4,p1,p2)

Returns:
host-port information in PORT command representation.