Class WebsaverConnection

java.lang.Object
   |
   +----WebsaverConnection

public class WebsaverConnection
extends Object
This class is the connection to the Websaver CGI script on the webserver. It is used iternally by WebsaverOutputStream and WebsaverInputStream

Author:
Brad Fitzpatrick <bradfitz@bradfitz.com>
See Also:
WebsaverOutputStream, WebsaverInputStream

Constructor Index

 o WebsaverConnection(String)
Constructor for the WebsaverConnection
 o WebsaverConnection(String, String)
Constructor for the WebsaverConnection

Method Index

 o decodeURL(String)
 o decToHex(int)
 o encodeURL(String)
 o hexValue(char[])
 o sendRequest(Hashtable)
Method that sends a POST request to the webserver.

Constructors

 o WebsaverConnection
 public WebsaverConnection(String url)
Constructor for the WebsaverConnection

Parameters:
url - The full URL of the CGI script that will be doing the loading/saving. Note that if used from an applet, the hostname of the URL must be the same as the one the applet was downloaded from.
 o WebsaverConnection
 public WebsaverConnection(String url,
                           String directory)
Constructor for the WebsaverConnection

Parameters:
url - The full URL of the CGI script that will be doing the loading/saving. Note that if used from an applet, the hostname of the URL must be the same as the one the applet was downloaded from.
directory - What directory on the server to store the files in. This is useful if you have different Java application/applets using one Websaver.cgi and want to keep the files seperate, because different application's files will invariably be of different types.

Methods

 o sendRequest
 public Hashtable sendRequest(Hashtable reqHash)
Method that sends a POST request to the webserver.

Parameters:
reqHash - A Hashtable of String keys/values to send in a request to the webserver. The required keys include "mode", and any other keys required for that mode.
Returns:
A Hashtable representing the String keys/values of the server's response. The keys will be different depending on the mode. The key "success" will always be one of "OK" or "FAIL". If it's FAIL, the key "errmsg" will say what went wrong.
 o hexValue
 public static int hexValue(char c[])
 o decodeURL
 public static String decodeURL(String in)
 o decToHex
 public static String decToHex(int i)
 o encodeURL
 public static String encodeURL(String in)