All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.andthehorseyourodeinon.ghear.Response

java.lang.Object
   |
   +----com.andthehorseyourodeinon.ghear.Response

public class Response
extends Object
Simple data-structure class for HTTP responses.

Version:
$Id: Response.java,v 1.1 2000/05/16 22:40:23 samuelg Exp $

Variable Index

 o returnCode
 o returnFile
 o returnText

Constructor Index

 o Response(int, String)
Constructor.
 o Response(int, String, boolean)
Constructor, with a sneaky way to return a file rather than a message.
 o Response(String)
Constructor.

Method Index

 o getCode()
 o getLen()
 o getText()
 o isFile()

Variables

 o returnCode
 public int returnCode
 o returnText
 public String returnText
 o returnFile
 public boolean returnFile

Constructors

 o Response
 public Response(String text)
Constructor.

Parameters:
text - the text of the message that's returned to the browser. It's automatically set to a 200 OK (HTTP_OK) HTTP status code.
 o Response
 public Response(int retCode,
                 String text)
Constructor.

Parameters:
retCode - the HTTP Status code to be returned. You can get these out of HttpURLConnector, or manually enter the integer value.
text - the text of the message that's returned to the browser.
 o Response
 public Response(int retCode,
                 String filespec,
                 boolean isFile)
Constructor, with a sneaky way to return a file rather than a message.

Parameters:
retCode - the HTTP Status code to be returned. You can get these out of HttpURLConnector, or manually enter the integer value.
filespec - the specification of the file containing the message that's returned to the browser.
isFile - if this is set to true, the contents of the file will be returned to the browser. Otherwise, the filespec will be returned.

Methods

 o getCode
 public int getCode()
Returns:
an integer containing the HTTP status code.
 o getLen
 public int getLen()
Returns:
an integer containing the length of the text to be returned, or the length of the filespec if a file is to be returned
 o getText
 public String getText()
Returns:
a String containing the text to be returned to the browser, or the name of the file to be returned
 o isFile
 public boolean isFile()
Returns:
a boolean. True if the response will return a file to the browser.

All Packages  Class Hierarchy  This Package  Previous  Next  Index