Package org.globus.ftp
Class HostPortList
- java.lang.Object
-
- org.globus.ftp.HostPortList
-
public class HostPortList extends java.lang.Object
Utility class for parsing and converting host-port information from SPAS and SPOR FTP commands. Represents a list of host-port pairs.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
sporCommandParam
private java.util.Vector
vector
-
Constructor Summary
Constructors Constructor Description HostPortList()
Creates an empty listHostPortList(java.lang.String spasReplyMsg)
Parses host-port from the reply to SPAS command.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(HostPort hp)
Adds an element to the listHostPort
get(int index)
private void
parseFormat(java.lang.String msg, boolean ipv6)
static HostPortList
parseIPv4Format(java.lang.String message)
static HostPortList
parseIPv6Format(java.lang.String message)
int
size()
java.lang.String
toFtpCmdArgument()
Returns the host-port infromation in the format used by SPOR command.
-
-
-
Method Detail
-
add
public void add(HostPort hp)
Adds an element to the list
-
size
public int size()
- Returns:
- number of elements in the list
-
get
public HostPort get(int index)
- Returns:
- element of the specified index
-
toFtpCmdArgument
public java.lang.String toFtpCmdArgument()
Returns the host-port infromation in the format used by SPOR command.- Returns:
- host-port information in SPOR command parameter representation.
-
parseFormat
private void parseFormat(java.lang.String msg, boolean ipv6) throws java.io.IOException
- Throws:
java.io.IOException
-
parseIPv6Format
public static HostPortList parseIPv6Format(java.lang.String message)
-
parseIPv4Format
public static HostPortList parseIPv4Format(java.lang.String message)
-
-