|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockftpserver.core.util.PortParser
public final class PortParser
Utility class for parsing host and port values from command arguments.
| Method Summary | |
|---|---|
static String |
convertHostAndPortToCommaDelimitedBytes(InetAddress host,
int port)
Convert the InetAddess and port number to a comma-delimited list of byte values, suitable for the response String from the PASV command. |
static HostAndPort |
parseExtendedAddressHostAndPort(String parameter)
Parse the host address and port number of an extended address. |
static HostAndPort |
parseHostAndPort(String[] parameters)
Parse a 32-bit IP address and 16-bit port number from the String[] of FTP command parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static HostAndPort parseExtendedAddressHostAndPort(String parameter)
parameter - - the single parameter String containing the encoded host and port number
public static HostAndPort parseHostAndPort(String[] parameters)
parameters - - the String[] of command parameters. It is the concatenation
of a 32-bit internet host address and a 16-bit TCP port address. This address
information is broken into 8-bit fields and the value of each field is encoded
as a separate parameter whose value is a decimal number (in character string
representation). Thus, the six parameters for the port command would be:
h1,h2,h3,h4,p1,p2
where h1 is the high order 8 bits of the internet host address, and p1 is the
high order 8 bits of the port number.
AssertFailedException - - if parameters is null or contains an insufficient number of elements
NumberFormatException - - if one of the parameters does not contain a parsable integer
public static String convertHostAndPortToCommaDelimitedBytes(InetAddress host,
int port)
host - - the InetAddressport - - the port number
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||