public class FingerClient extends SocketClient
FingerClient finger;
finger = new FingerClient();
try {
finger.connect("foo.bar.com");
System.out.println(finger.query("foobar", false));
finger.disconnect();
} catch(IOException e) {
System.err.println("Error I/O exception: " + e.getMessage());
return;
}
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
The default FINGER port.
|
_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL| Constructor and Description |
|---|
FingerClient()
The default FingerClient constructor.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getInputStream(boolean longOutput)
Fingers the connected host and returns the input stream from
the network connection of the finger query.
|
InputStream |
getInputStream(boolean longOutput,
String username)
Fingers a user and returns the input stream from the network connection
of the finger query.
|
InputStream |
getInputStream(boolean longOutput,
String username,
String encoding)
Fingers a user and returns the input stream from the network connection
of the finger query.
|
String |
query(boolean longOutput)
Fingers the connected host and returns the output
as a String.
|
String |
query(boolean longOutput,
String username)
Fingers a user at the connected host and returns the output
as a String.
|
_connectAction_, addProtocolCommandListener, connect, connect, connect, connect, connect, connect, createCommandSupport, disconnect, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getCommandSupport, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemotepublic static final int DEFAULT_PORT
public FingerClient()
DEFAULT_PORT .public String query(boolean longOutput, String username) throws IOException
longOutput - Set to true if long output is requested, false if not.username - The name of the user to finger.IOException - If an I/O error occurs while reading the socket.public String query(boolean longOutput) throws IOException
query(longOutput, "") .longOutput - Set to true if long output is requested, false if not.IOException - If an I/O error occurs while reading the socket.public InputStream getInputStream(boolean longOutput, String username) throws IOException
longOutput - Set to true if long output is requested, false if not.username - The name of the user to finger.IOException - If an I/O error during the operation.public InputStream getInputStream(boolean longOutput, String username, String encoding) throws IOException
longOutput - Set to true if long output is requested, false if not.username - The name of the user to finger.encoding - the character encoding that should be used for the query,
null for the platform's default encodingIOException - If an I/O error during the operation.public InputStream getInputStream(boolean longOutput) throws IOException
longOutput - Set to true if long output is requested, false if not.IOException - If an I/O error during the operation.Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.