| java.lang.Object org.apache.commons.net.SocketClient org.apache.commons.net.FingerClient
All known Subclasses: org.apache.commons.net.WhoisClient,
FingerClient | public class FingerClient extends SocketClient (Code) | | 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;
}
author: Daniel F. Savarese |
Field Summary | |
final public static int | DEFAULT_PORT The default FINGER port. |
Constructor Summary | |
public | FingerClient() The default FingerClient constructor. |
Method Summary | |
public InputStream | getInputStream(boolean longOutput, String username) Fingers a user and returns the input stream from the network connection
of the finger query. | public InputStream | getInputStream(boolean longOutput) Fingers the connected host and returns the input stream from
the network connection of the finger query. | public String | query(boolean longOutput, String username) Fingers a user at the connected host and returns the output
as a String. | public String | query(boolean longOutput) Fingers the connected host and returns the output
as a String. |
DEFAULT_PORT | final public static int DEFAULT_PORT(Code) | | The default FINGER port. Set to 79 according to RFC 1288.
|
FingerClient | public FingerClient()(Code) | | The default FingerClient constructor. Initializes the
default port to DEFAULT_PORT .
|
getInputStream | public InputStream getInputStream(boolean longOutput, String username) throws IOException(Code) | | Fingers a user and returns the input stream from the network connection
of the finger query. You must first connect to a finger server before
calling this method, and you should disconnect after finishing reading
the stream.
Parameters: longOutput - Set to true if long output is requested, false if not. Parameters: username - The name of the user to finger. The InputStream of the network connection of the finger query.Can be read to obtain finger results. exception: IOException - If an I/O error during the operation. |
getInputStream | public InputStream getInputStream(boolean longOutput) throws IOException(Code) | | Fingers the connected host and returns the input stream from
the network connection of the finger query. This is equivalent to
calling getInputStream(longOutput, ""). You must first connect to a
finger server before calling this method, and you should disconnect
after finishing reading the stream.
Parameters: longOutput - Set to true if long output is requested, false if not. The InputStream of the network connection of the finger query.Can be read to obtain finger results. exception: IOException - If an I/O error during the operation. |
query | public String query(boolean longOutput, String username) throws IOException(Code) | | Fingers a user at the connected host and returns the output
as a String. You must first connect to a finger server before
calling this method, and you should disconnect afterward.
Parameters: longOutput - Set to true if long output is requested, false if not. Parameters: username - The name of the user to finger. The result of the finger query. exception: IOException - If an I/O error occurs while reading the socket. |
query | public String query(boolean longOutput) throws IOException(Code) | | Fingers the connected host and returns the output
as a String. You must first connect to a finger server before
calling this method, and you should disconnect afterward.
This is equivalent to calling query(longOutput, "") .
Parameters: longOutput - Set to true if long output is requested, false if not. The result of the finger query. exception: IOException - If an I/O error occurs while reading the socket. |
Methods inherited from org.apache.commons.net.SocketClient | protected void _connectAction_() throws IOException(Code)(Java Doc) public void connect(InetAddress host, int port) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname, int port) throws SocketException, IOException(Code)(Java Doc) public void connect(InetAddress host, int port, InetAddress localAddr, int localPort) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname, int port, InetAddress localAddr, int localPort) throws SocketException, IOException(Code)(Java Doc) public void connect(InetAddress host) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname) throws SocketException, IOException(Code)(Java Doc) public void disconnect() throws IOException(Code)(Java Doc) public int getDefaultPort()(Code)(Java Doc) public int getDefaultTimeout()(Code)(Java Doc) public InetAddress getLocalAddress()(Code)(Java Doc) public int getLocalPort()(Code)(Java Doc) public InetAddress getRemoteAddress()(Code)(Java Doc) public int getRemotePort()(Code)(Java Doc) public int getSoLinger() throws SocketException(Code)(Java Doc) public int getSoTimeout() throws SocketException(Code)(Java Doc) public boolean getTcpNoDelay() throws SocketException(Code)(Java Doc) public boolean isConnected()(Code)(Java Doc) public void setDefaultPort(int port)(Code)(Java Doc) public void setDefaultTimeout(int timeout)(Code)(Java Doc) public void setSoLinger(boolean on, int val) throws SocketException(Code)(Java Doc) public void setSoTimeout(int timeout) throws SocketException(Code)(Java Doc) public void setSocketFactory(SocketFactory factory)(Code)(Java Doc) public void setTcpNoDelay(boolean on) throws SocketException(Code)(Java Doc) public boolean verifyRemote(Socket socket)(Code)(Java Doc)
|
|
|