|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.ServerSocket
com.lukasfeiler.tcpserver.TCPServer
com.lukasfeiler.httpd.HTTPServer
This class implements a simple and secure HTTP server.
| Constructor Summary | |
protected |
HTTPServer(java.util.Map configuration)
Constructor. |
| Method Summary | |
static HTTPServer |
configuredHTTPServer(java.lang.String configFile)
Factory method. |
java.lang.String |
getConfigurationOption(java.lang.String name,
java.lang.String defaultValue)
Returns the specified configuration option and in case it is undefined a default value. |
java.lang.String |
getContentType(java.io.File f)
Returns the content type of the file pass as argument. |
java.lang.String |
getDate()
Returns the current date and time. |
java.io.File |
getDocumentRoot()
Returns an instance of File for the document root - please see the configuration option DocumentRoot. |
java.lang.String |
getFileExtension(java.io.File f)
Returns the extension of the file pass as argument. |
java.lang.String |
getListenAddress()
Returns the address the server listens on - please see the configuration option ListenAddress. |
java.lang.String |
getListenPort()
Returns the port the server listens on - please see the configuration option ListenPort. |
HTTPServerPlugin[] |
getPlugins()
Returns the loaded plugins - please see the configuration option Plugins. |
java.lang.String |
getServerBanner()
Return the server banner - please see the configuration option ServerBanner. |
void |
logAccess(HTTPSocket socket,
java.io.File f,
java.lang.String requestedResource,
java.util.Vector headers,
int statusCode,
int byteSize)
Write to access log file. |
void |
logError(HTTPSocket socket,
java.io.File f,
java.lang.String requestedResource,
java.util.Vector headers,
int statusCode,
java.lang.String message)
Write to error log file. |
void |
logError(java.lang.String message)
Write to error log file. |
void |
logSecure(HTTPSocket socket,
java.io.File f,
java.lang.String requestedResource,
java.util.Vector headers,
java.lang.String message)
Write to secure log file. |
static void |
main(java.lang.String[] args)
Create a new HTTPServer with the configuration file passed as argument. |
protected com.lukasfeiler.tcpserver.TCPSocket |
socketFactory(java.net.Socket tcpSocket,
java.lang.Integer socketId,
com.lukasfeiler.tcpserver.TCPServer tcpServer,
int connectionTimeout)
Factory method for creating new sockets. |
| Methods inherited from class com.lukasfeiler.tcpserver.TCPServer |
connectionMaximumExceeded, connectionMaximumReached, getConnectionLifetime, getConnectionMaximum, getConnectionMaximumDelay, getConnectionQueueLength, getConnectionTimeout, removeSocket, start, stop |
| Methods inherited from class java.net.ServerSocket |
accept, bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected HTTPServer(java.util.Map configuration)
throws java.io.IOException
configuredHTTPServer(String configFile)| Method Detail |
public static HTTPServer configuredHTTPServer(java.lang.String configFile)
configFile - Path the the configuration file (usually named httpd.conf).
protected com.lukasfeiler.tcpserver.TCPSocket socketFactory(java.net.Socket tcpSocket,
java.lang.Integer socketId,
com.lukasfeiler.tcpserver.TCPServer tcpServer,
int connectionTimeout)
throws java.io.IOException
java.io.IOExceptionHTTPSocketpublic java.io.File getDocumentRoot()
public java.lang.String getListenAddress()
public java.lang.String getListenPort()
public HTTPServerPlugin[] getPlugins()
public java.lang.String getConfigurationOption(java.lang.String name,
java.lang.String defaultValue)
public java.lang.String getContentType(java.io.File f)
public java.lang.String getFileExtension(java.io.File f)
public java.lang.String getDate()
public java.lang.String getServerBanner()
public void logAccess(HTTPSocket socket,
java.io.File f,
java.lang.String requestedResource,
java.util.Vector headers,
int statusCode,
int byteSize)
public void logError(java.lang.String message)
public void logError(HTTPSocket socket,
java.io.File f,
java.lang.String requestedResource,
java.util.Vector headers,
int statusCode,
java.lang.String message)
public void logSecure(HTTPSocket socket,
java.io.File f,
java.lang.String requestedResource,
java.util.Vector headers,
java.lang.String message)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||