|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.Agent
com.cometway.ak.ServiceAgent
com.cometway.httpd.WebServerExtension
com.cometway.httpd.HTTPFileServerAgent
public class HTTPFileServerAgent
This agent is used by the WebServer to handle requests for HTML files and other static documents from the file system.
| Field Summary | |
|---|---|
protected java.lang.String |
html_directory
|
| Fields inherited from class com.cometway.ak.Agent |
|---|
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter |
| Constructor Summary | |
|---|---|
HTTPFileServerAgent()
|
|
| Method Summary | |
|---|---|
java.lang.String |
generateDirectoryList(java.io.File file,
java.lang.String path)
Generates a directory Listing. |
boolean |
handleRequest(HTTPAgentRequest request)
Writes the entire http response header. |
void |
initProps()
Initializes this agent's properties by providing default values for each of the following missing properties: "service_name" is used to register this agent with the Service Manager (default: HTTPFileServerAgent), "html_directory" points to the root directory where HTML files are served (default: ./), "default_index" is the default file served when no filename is specified, can be more than one index (default: index.html), "allow_directory_lists" when enabled, allows this agent to display links to files in a directory (default: yes) "domains" used for registering extension, can be more than one domain (default: default) |
boolean |
isKeepAlive(AgentRequest request)
Checks if the request given asks for a keep-alive |
protected void |
printRedirect(HTTPAgentRequest request,
java.lang.String path,
boolean keepAlive)
Prints redirect information for a site to HTML output. |
protected void |
sendFile(java.io.File file,
HTTPAgentRequest request)
|
void |
start()
Registers Server and sets up directories, url's, etc. |
| Methods inherited from class com.cometway.ak.ServiceAgent |
|---|
stop |
| Methods inherited from class com.cometway.ak.Agent |
|---|
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String html_directory
| Constructor Detail |
|---|
public HTTPFileServerAgent()
| Method Detail |
|---|
public void initProps()
initProps in interface AgentInterfaceinitProps in class Agentpublic void start()
start in interface AgentInterfacestart in class WebServerExtension
protected void printRedirect(HTTPAgentRequest request,
java.lang.String path,
boolean keepAlive)
public boolean isKeepAlive(AgentRequest request)
public boolean handleRequest(HTTPAgentRequest request)
handleRequest in class WebServerExtension
protected void sendFile(java.io.File file,
HTTPAgentRequest request)
throws java.io.IOException
java.io.IOException
public java.lang.String generateDirectoryList(java.io.File file,
java.lang.String path)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||