Class Cgi

java.lang.Object
  extended byCgi

public class Cgi
extends java.lang.Object

CGI control handler.

Version:
$Id: $
Author:
Jim Wiggins, iWiggins.com

Constructor Summary
Cgi()
          Constructor.
Cgi(int maxchars)
          Constructor.
 
Method Summary
 java.util.Set controlNames()
          Control names accessor.
 java.lang.String controlSetting(java.lang.String control)
          Control setting accessor.
 java.util.Set controlSettings(java.lang.String control)
          Control settings accessor.
 java.lang.String error()
          Error code accessor.
static void main(java.lang.String[] args)
          Test method.
static java.lang.String urlDecode(java.lang.String in)
          Utility to URL decode a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cgi

public Cgi()
Constructor.


Cgi

public Cgi(int maxchars)
Constructor.

Parameters:
maxchars - - the max number of characters to accept
Method Detail

error

public java.lang.String error()
Error code accessor.

Returns:
Error string, empty if no error.

controlNames

public java.util.Set controlNames()
Control names accessor.

Returns:
Set of control names.

controlSetting

public java.lang.String controlSetting(java.lang.String control)
                                throws java.lang.Exception
Control setting accessor.

Returns:
The one setting for a given control, null if not set.
Throws:
java.lang.Exception - if there are more than one setting.

controlSettings

public java.util.Set controlSettings(java.lang.String control)
Control settings accessor.

Returns:
Set of settings for a given control.

urlDecode

public static java.lang.String urlDecode(java.lang.String in)
Utility to URL decode a string. Data passed through the CGI API is URL encoded by the browser. All spaces are turned into plus characters (+) and all "special" characters are hex escaped into a %dd format (where dd is the hex ASCII value that represents the original character).

Parameters:
in - The string you wish to decode.
Returns:
The decoded string.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test method.

Throws:
java.lang.Exception