Femto Web Server V1.4-F

dfischer.femtowebserver.httpd
Class HttpdProperties

java.lang.Object
  |
  +--dfischer.femtowebserver.httpd.HttpdProperties

public class HttpdProperties
extends java.lang.Object

Allows Weblets, SSSIs, filters and connection adapters to access the configuration of the Femto Web Server (read/only access).

See Also:
Httpd, HttpdWebletInterface, HttpdSssiInterface, HttpdFilter, HttpdConnectionAdapterInterface

Field Summary
static java.lang.String[][] EXTENDED_MIME_MAPPING
          Extended MIME mapping definition (less secure).
static java.lang.String PRODUCT_MANUFACTURER
          Femto Web Sever Manufacturer: "www.d-fischer.com"
static java.lang.String PRODUCT_NAME
          HTTP Web Server Product Name: "Femto Web Server"
static java.lang.String PRODUCT_VERSION
          Femto Web Sever Version: "1.4-F"
static java.lang.String[][] RESTRICTED_MIME_MAPPING
          Restricted MIME mapping definition (more secure).
 
Method Summary
 java.net.InetAddress getBindAddress()
          Returns the HTTP server TCP/IP bind address.
 java.lang.Class getConnectionAdapterClass()
          Returns the class of the currently used connection adapter.
 java.lang.String getDefaultContent()
          Returns the default file, if the URL request points to a directory.
 java.lang.String getDefaultMimeType()
          Returns the default MIME type.
 java.lang.String[][] getMimeMapping()
          Returns the current MIME mapping.
 java.lang.Object getProperty(java.lang.String key)
          Returns a reference to an object which has been set with Httpd.setProperty(java.lang.String, java.lang.Object).
 int getRequestTimeout()
          Returns the HTTP request timeout.
 java.lang.String getServerName()
          Returns the HTTP server name.
 int getServerPort()
          Returns the HTTP server port.
 HttpdSessionHashtable getSessionHashtable()
          Allows direct access to the session hashtable of the Femto Web Server instance.
 java.lang.String[][] getUrlFileMapping()
          Returns an array of all url file mappings.
 java.lang.String getWelcomePage()
          Returns for HTTP requests to the top level default URL "/" the welcome page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRODUCT_NAME

public static final java.lang.String PRODUCT_NAME
HTTP Web Server Product Name: "Femto Web Server"

PRODUCT_VERSION

public static final java.lang.String PRODUCT_VERSION
Femto Web Sever Version: "1.4-F"

PRODUCT_MANUFACTURER

public static final java.lang.String PRODUCT_MANUFACTURER
Femto Web Sever Manufacturer: "www.d-fischer.com"

EXTENDED_MIME_MAPPING

public static final java.lang.String[][] EXTENDED_MIME_MAPPING
Extended MIME mapping definition (less secure).

 EXTENDED_MIME_MAPPING = { {"class", "text/html"},                     // only for weblets
                           {"html", "text/html"},
                           {"htm", "text/html"},
                           {"dat", "text/plain"},                      // bad for security
                           {"txt", "text/plain"},                      // bad for security
                           {"log", "text/plain"},                      // bad for security
                           {"css", "text/css"},
                           {"js", "application/x-javascript"},
                           {"tif", "image/tiff"},
                           {"tiff", "image/tiff"},
                           {"jpg", "image/jpeg"},
                           {"jpeg", "image/jpeg"},
                           {"gif", "image/gif"},
                           {"png", "image/png"},
                           {"bmp", "image/bmp"},
                           {"vaw", "audio/x-wav"},
                           {"ra", "audio/x-realaudio"},
                           {"aif", "audio/x-aiff"},
                           {"au", "audio/basic"},
                           {"snd", "audio/basic"},
                           {"mpga", "audio/mpeg"},
                           {"mp2", "audio/mpeg"},
                           {"mp3", "audio/mpeg"},
                           {"mpeg", "video/mpeg"},
                           {"mpg", "video/mpeg"},
                           {"mpe", "video/mpeg"},
                           {"qt", "video/quicktime"},
                           {"mov", "video/quicktime"},
                           {"avi", "video/x-msvideo"},                // bad for security
                           {"movie", "video/x-sgi-movie"},
                           {"rtf", "text/rtf"},
                           {"doc", "application/msword"},             // bad for security
                           {"xls", "application/vnd.ms-excel"},       // bad for security
                           {"ppt", "application/vnd.ms-powerpoint"},  // bad for security
                           {"ai", "application/postscript"},
                           {"eps", "application/postscript"},
                           {"ps", "application/postscript"},
                           {"swf", "application/x-shockwave-flash"},  // bad for security
                           {"pdf", "application/pdf"} };              // bad for security
 
See Also:
Httpd.setExtendedMimeMapping(), getMimeMapping()

RESTRICTED_MIME_MAPPING

public static final java.lang.String[][] RESTRICTED_MIME_MAPPING
Restricted MIME mapping definition (more secure).

 RESTRICTED_MIME_MAPPING = { {"class", "text/html"},    // only for weblets
                             {"html", "text/html"},
                             {"htm", "text/html"},
                             {"jpg", "image/jpeg"},
                             {"jpeg", "image/jpeg"},
                             {"gif", "image/gif"},
                             {"png", "image/png"},
                             {"bmp", "image/bmp"},
                             {"css", "text/css"},
                             {"js", "application/x-javascript"} };
 
See Also:
Httpd.setRestrictedMimeMapping(), getMimeMapping()
Method Detail

getConnectionAdapterClass

public java.lang.Class getConnectionAdapterClass()
Returns the class of the currently used connection adapter.
Returns:
the class of the currently used connection adapter
See Also:
Httpd.setConnectionAdapterClass(java.lang.String), HttpdConnectionAdapterInterface

getServerName

public java.lang.String getServerName()
Returns the HTTP server name.
Returns:
HTTP server name
See Also:
Httpd.setServerName(java.lang.String)

getServerPort

public int getServerPort()
Returns the HTTP server port.
Returns:
HTTP server port
See Also:
Httpd.setServerPort(int)

getBindAddress

public java.net.InetAddress getBindAddress()
Returns the HTTP server TCP/IP bind address.
Returns:
HTTP server TCP/IP bind address or null, if the server is listening to all TCP/IP addresses.
See Also:
Httpd.setBindAddress(java.lang.String)

getRequestTimeout

public int getRequestTimeout()
Returns the HTTP request timeout.
Returns:
request timeout in seconds
See Also:
Httpd.setRequestTimeout(int)

getDefaultContent

public java.lang.String getDefaultContent()
Returns the default file, if the URL request points to a directory.
Returns:
the default file
See Also:
Httpd.setDefaultContent(java.lang.String)

getWelcomePage

public java.lang.String getWelcomePage()
Returns for HTTP requests to the top level default URL "/" the welcome page.
Returns:
the welcome page
See Also:
Httpd.setWelcomePage(java.lang.String)

getUrlFileMapping

public java.lang.String[][] getUrlFileMapping()
Returns an array of all url file mappings.
Returns:
an array[0..n-1][0..1] of all url file mappings.
[n][0] contains the request file path
[n][1] contains the request the mapped path
See Also:
Httpd.addUrlFileMapping(java.lang.String, java.lang.String), Httpd.removeUrlFileMapping(java.lang.String)

getDefaultMimeType

public java.lang.String getDefaultMimeType()
Returns the default MIME type. If the Femto Web server is unable determine the MIME type from the HTTP request file, the default MIMRE type will be applied - or a "400 Bad Request" will be the HTTP response, if no default MIME type has been configured.
Returns:
the default MIME type or null, if no default MIME type has been configured
See Also:
Httpd.setDefaultMimeType(java.lang.String)

getMimeMapping

public java.lang.String[][] getMimeMapping()
Returns the current MIME mapping.
Returns:
the current MIME mapping
See Also:
RESTRICTED_MIME_MAPPING, EXTENDED_MIME_MAPPING, Httpd.setRestrictedMimeMapping(), Httpd.setExtendedMimeMapping(), Httpd.setMimeMapping(java.lang.String[][])

getSessionHashtable

public HttpdSessionHashtable getSessionHashtable()
Allows direct access to the session hashtable of the Femto Web Server instance. Used in filters.
Returns:
the session hashtable of the Femto Web Server instance.
See Also:
HttpdSession, HttpdFilter.getHttpdProperties()

getProperty

public java.lang.Object getProperty(java.lang.String key)
Returns a reference to an object which has been set with Httpd.setProperty(java.lang.String, java.lang.Object).
Returns:
reference to an object, selected by its key. Returns null if no object with this key was found.

Femto Web Server V1.4-F

Copyright 2002, 2003, 2006 by Ingenieurbüro David Fischer GmbH, Switzerland. All rights reserved.