|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.net.SocketClient
org.apache.commons.net.finger.FingerClient
public class FingerClient
The FingerClient class implements the client side of the Internet Finger Protocol defined in RFC 1288. To finger a host you create a FingerClient instance, connect to the host, query the host, and finally disconnect from the host. If the finger service you want to query is on a non-standard port, connect to the host at that port. Here's a sample use:
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;
}
| Field Summary | |
|---|---|
static int |
DEFAULT_PORT
The default FINGER port. |
| Fields inherited from class org.apache.commons.net.SocketClient |
|---|
_defaultPort_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL |
| Constructor Summary | |
|---|---|
FingerClient()
The default FingerClient constructor. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.apache.commons.net.SocketClient |
|---|
_connectAction_, connect, connect, connect, connect, connect, connect, disconnect, getConnectTimeout, getDefaultPort, getDefaultTimeout, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setConnectTimeout, setDefaultPort, setDefaultTimeout, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_PORT
| Constructor Detail |
|---|
public FingerClient()
DEFAULT_PORT .
| Method Detail |
|---|
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 encoding
IOException - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||