java.lang.Object
|
+--stec.iws.iws
public final class iws
Contains main entry point and global methods.
Fields
|
Field
|
Description
|
|
aliases
|
Used to access, add, remove and change aliases.
|
|
hosts
|
Used to access, add, remove and change virtual hosts.
|
|
messages
|
Used to access, add, remove and change messages.
|
|
mimetypes
|
Used to access, add, remove and change mimetypes.
|
|
resources
|
Used to access, add, remove and change resources.
|
|
servlets
|
Used to access, add, remove and change servlets.
|
Methods
|
Method
|
Description
|
|
getBaseDirectory
|
Returns the base directory or archive that Servertec Internet Server uses to
run from.
|
|
getMimeType
|
Returns the MIME type of the specified file.
|
|
getServerVersion
|
Returns the current version of Servertec Internet Server.
|
|
getStartTime
|
Returns the time in milliseconds since January 1, 1970 UTC when the server was started.
|
|
log
|
Used to log exceptions or errors messages.
|
|
main
|
Main entry point.
|
|
shutdown
|
Used by administration thread to shutdown Servertec Internet Server.
|
aliases
Used to access, add, remove and change aliases.
Syntax
public static Hashtable aliases
Notes
Aliases are automatically loaded when the server is started.
Example
iws.aliases.put("/scripts", "/cgi-bin")
hosts
Used to access, add, remove and change virtual hosts.
Syntax
public static Hashtable hosts
Notes
Hosts are automatically loaded when the server is started.
Example
iws.hosts.put("iob", "./servers/iob")
messages
Used to access, add, remove and change messages.
Syntax
public static Hashtable messages
Notes
Messages are automatically loaded when the server is started.
Example
iws.messages.put("200", "200 OK")
mimetypes
Used to access, add, remove and change mimetypes.
Syntax
public static Hashtable mimetypes
Notes
Mimetypes are automatically loaded when the server is started.
Example
iws.mimetypes.put(".htm", "text/html")
resources
Used to access, add, remove and change resources.
Syntax
public static Hashtable resources
Notes
Resources are automatically loaded when the server is started.
Example
iws.resources.put("/protected", "default")
servlets
Used to access, add, remove and change servlets.
Syntax
public static Hashtable servlets
Notes
Servlets are automatically loaded when the server is started.
Example
iws.servlets.put("FileServlet", "stec.iws.FileServlet")
destroy
Stops the Servertec Internet Server runtime environment.
Syntax
public final static void destroy()
Parameters
Returns
Throws
Example
iws.destroy();
getBaseDirectory
Returns the base directory or archive that Servertec Internet Server uses to
run from.
Syntax
public final static String getBaseDirectory()
Parameters
Returns
|
String
|
the base directory or archive file.
|
Throws
Notes
A files MIME, Multipurpose Internet Mail Extension, type is a Web protocol
for defining a files type.
Example
String base_dir = iws.getBaseDirectory();
getMimeType
Returns the MIME type of the specified file.
Syntax
public final static String getMimeType(String filename)
Parameters
|
filename
|
the filename to use.
|
Returns
|
String
|
the associated mime type.
|
Throws
Notes
A files MIME, Multipurpose Internet Mail Extension, type is a Web protocol
for defining a files type.
Example
String mimetype = iws.getMimeType(filename);
getServerVersion
Returns the current version of Servertec Internet Server.
Syntax
public final static String getServerVersion()
Parameters
Returns
|
String
|
the current version of Servertec Internet Server.
|
Throws
Example
String version = iws.getServerVersion();
getStartTime
Returns the time in milliseconds since January 1, 1970 UTC when the server was started.
Syntax
public final static long getStartTime()
Parameters
Returns
|
long
|
the time in milliseconds since January 1, 1970 UTC when the server was started.
|
Throws
Example
long start_time = iws.getStartTime();
log
Used to log exceptions or errors messages.
Syntax
public final static void log(Throwable exception)
public final static void log(String message)
public final static void log(Throwable exception, String message)
Parameters
|
exception
|
an Error or Exception object.
|
|
message
|
event message to log.
|
Returns
Throws
Example
iws.destroy();
main
Main entry point.
Syntax
public final static void main(String args) throws Exception
Parameters
|
args
|
command line arguments.
|
Returns
Notes
Called by Java VM when server is started. Initialized and starts the server.
Throws
|
Exception
|
Thrown if any error occurs while the server is being initialized or started.
|
Example
iws.main(args);
shutdown
Used by administration thread to shutdown Servertec Internet Server.
Syntax
public final static void shutdown(int returnCode)
Parameters
|
returnCode
|
the return code to return to the iws wrapper.
0 to stop the server or 0x7fff to restart the server.
|
Returns
Throws
Example
iws.shutdown(0);
|