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 |
---|---|
private char[] |
__buffer |
private static java.lang.String |
__LONG_FLAG |
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 |
---|---|
java.io.InputStream |
getInputStream(boolean longOutput)
Fingers the connected host and returns the input stream from
the network connection of the finger query.
|
java.io.InputStream |
getInputStream(boolean longOutput,
java.lang.String username)
Fingers a user and returns the input stream from the network connection
of the finger query.
|
java.io.InputStream |
getInputStream(boolean longOutput,
java.lang.String username,
java.lang.String encoding)
Fingers a user and returns the input stream from the network connection
of the finger query.
|
java.lang.String |
query(boolean longOutput)
Fingers the connected host and returns the output
as a String.
|
java.lang.String |
query(boolean longOutput,
java.lang.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, verifyRemote
public static final int DEFAULT_PORT
private static final java.lang.String __LONG_FLAG
private transient char[] __buffer
public FingerClient()
DEFAULT_PORT
.public java.lang.String query(boolean longOutput, java.lang.String username) throws java.io.IOException
longOutput
- Set to true if long output is requested, false if not.username
- The name of the user to finger.java.io.IOException
- If an I/O error occurs while reading the socket.public java.lang.String query(boolean longOutput) throws java.io.IOException
query(longOutput, "")
.longOutput
- Set to true if long output is requested, false if not.java.io.IOException
- If an I/O error occurs while reading the socket.public java.io.InputStream getInputStream(boolean longOutput, java.lang.String username) throws java.io.IOException
longOutput
- Set to true if long output is requested, false if not.username
- The name of the user to finger.java.io.IOException
- If an I/O error during the operation.public java.io.InputStream getInputStream(boolean longOutput, java.lang.String username, java.lang.String encoding) throws java.io.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 encodingjava.io.IOException
- If an I/O error during the operation.public java.io.InputStream getInputStream(boolean longOutput) throws java.io.IOException
longOutput
- Set to true if long output is requested, false if not.java.io.IOException
- If an I/O error during the operation.