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
-
WebsaverConnection(String)
- Constructor for the WebsaverConnection
-
WebsaverConnection(String, String)
- Constructor for the WebsaverConnection
-
decodeURL(String)
-
-
decToHex(int)
-
-
encodeURL(String)
-
-
hexValue(char[])
-
-
sendRequest(Hashtable)
- Method that sends a POST request to the webserver.
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.
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.
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.
hexValue
public static int hexValue(char c[])
decodeURL
public static String decodeURL(String in)
decToHex
public static String decToHex(int i)
encodeURL
public static String encodeURL(String in)