gnu.inet.gopher
Class GopherConnection
java.lang.Object
gnu.inet.gopher.GopherConnection
public class GopherConnection
extends java.lang.Object
A gopher client.
Version:
- Chris Burdess
static int | DEFAULT_PORT - The default gopher port.
|
protected java.io.InputStream | in
|
protected java.io.OutputStream | out
|
protected java.net.Socket | socket
|
GopherConnection(java.lang.String host) - Creates a new connection to the gopher server at the specified
hostname.
|
GopherConnection(java.lang.String host, int port) - Creates a new connection to the gopher server at the specified
hostname with the specified non-standard port.
|
java.io.InputStream | get(java.lang.String selector) - Returns the resource identified by the specified selector.
|
DirectoryListing | list() - Returns the directory listing for this gopher server.
|
DEFAULT_PORT
public static final int DEFAULT_PORT
The default gopher port.
- 80
in
protected java.io.InputStream in
out
protected java.io.OutputStream out
socket
protected java.net.Socket socket
GopherConnection
public GopherConnection(java.lang.String host)
throws java.io.IOException
Creates a new connection to the gopher server at the specified
hostname.
GopherConnection
public GopherConnection(java.lang.String host,
int port)
throws java.io.IOException
Creates a new connection to the gopher server at the specified
hostname with the specified non-standard port.
port
- the non-standard port to use
get
public java.io.InputStream get(java.lang.String selector)
throws java.io.IOException
Returns the resource identified by the specified selector.
If the resource is text-based, it will need to be wrapped in a
CRLFInputStream.
list
public DirectoryListing list()
throws java.io.IOException
Returns the directory listing for this gopher server.
When all entries have been read from the listing, the connection will
be closed.
© Copyright 2003 The Free Software Foundation,
all rights reserved