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_, _input_, _isConnected_, _output_, _socket_, _socketFactory_, _timeout_, 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.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_, connect, connect, connect, connect, connect, connect, disconnect, getDefaultPort, getDefaultTimeout, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setDefaultPort, setDefaultTimeout, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
public static final int DEFAULT_PORT
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) 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.