gnu.inet.gopher
Class GopherConnection
java.lang.Object
gnu.inet.gopher.GopherConnection
public class GopherConnection
extends java.lang.Object
A gopher client.
- Chris Burdess
static int | DEFAULT_PORT - The default gopher port.
|
protected InputStream | in
|
protected OutputStream | out
|
protected Socket | socket
|
GopherConnection(String host) - Creates a new connection to the gopher server at the specified
hostname.
|
GopherConnection(String host, int port) - Creates a new connection to the gopher server at the specified
hostname with the specified non-standard port.
|
InputStream | get(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 InputStream in
out
protected OutputStream out
socket
protected Socket socket
GopherConnection
public GopherConnection(String host)
throws IOException
Creates a new connection to the gopher server at the specified
hostname.
GopherConnection
public GopherConnection(String host,
int port)
throws 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 InputStream get(String selector)
throws 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 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