VAJToolsServlet (Apache Ant API)

org.apache.tools.ant.taskdefs.optional.ide
Class VAJToolsServlet


java.lang.Object

  |

  +--javax.servlet.GenericServlet

        |

        +--javax.servlet.http.HttpServlet

              |

              +--org.apache.tools.ant.taskdefs.optional.ide.VAJToolsServlet

All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
VAJExportServlet, VAJImportServlet, VAJLoadServlet

public abstract class VAJToolsServlet
extends javax.servlet.http.HttpServlet

Abstract base class to provide common services for the VAJ tool API servlets

Author:
Wolf Siberski, based on servlets written by Glenn McAllister
See Also:
Serialized Form

Field Summary
static java.lang.String CLASSES_PARAM
           
static java.lang.String DEFAULT_EXCLUDES_PARAM
           
static java.lang.String DIR_PARAM
           
static java.lang.String EXCLUDE_PARAM
           
static java.lang.String INCLUDE_PARAM
           
static java.lang.String PROJECT_NAME_PARAM
           
static java.lang.String RESOURCES_PARAM
           
static java.lang.String SOURCES_PARAM
           
 
Constructor Summary
VAJToolsServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Respond to a HTTP request.
protected abstract  void executeRequest()
          Execute the request by calling the appropriate VAJ tool API methods.
protected  boolean getBooleanParam(java.lang.String param)
          Get the boolean value of a parameter.
protected  boolean getBooleanParam(java.lang.String param, boolean defaultValue)
          Get the boolean value of a parameter, with a default value if the parameter hasn't been passed to the servlet.
protected  java.lang.String getFirstParamValueString(java.lang.String param)
          Returns the first encountered value for a parameter.
protected  java.lang.String[] getParamValues(java.lang.String param)
          Returns all values for a parameter.
protected  void initRequest()
          initialize the servlet.
protected  boolean toBoolean(java.lang.String string)
          A utility method to translate the strings "yes", "true", and "ok" to boolean true, and everything else to false.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIR_PARAM


public static final java.lang.String DIR_PARAM
See Also:
Constant Field Values

INCLUDE_PARAM


public static final java.lang.String INCLUDE_PARAM
See Also:
Constant Field Values

EXCLUDE_PARAM


public static final java.lang.String EXCLUDE_PARAM
See Also:
Constant Field Values

CLASSES_PARAM


public static final java.lang.String CLASSES_PARAM
See Also:
Constant Field Values

SOURCES_PARAM


public static final java.lang.String SOURCES_PARAM
See Also:
Constant Field Values

RESOURCES_PARAM


public static final java.lang.String RESOURCES_PARAM
See Also:
Constant Field Values

DEFAULT_EXCLUDES_PARAM


public static final java.lang.String DEFAULT_EXCLUDES_PARAM
See Also:
Constant Field Values

PROJECT_NAME_PARAM


public static final java.lang.String PROJECT_NAME_PARAM
See Also:
Constant Field Values
Constructor Detail

VAJToolsServlet


public VAJToolsServlet()
Method Detail

executeRequest


protected abstract void executeRequest()
Execute the request by calling the appropriate VAJ tool API methods. This method must be implemented by the concrete servlets


doGet


public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  java.io.IOException
Respond to a HTTP request. This method initializes the servlet and handles errors. The real work is done in the abstract method executeRequest()

Overrides:
doGet in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

initRequest


protected void initRequest()
                    throws java.io.IOException
initialize the servlet.

java.io.IOException

getBooleanParam


protected boolean getBooleanParam(java.lang.String param)
Get the boolean value of a parameter.


getBooleanParam


protected boolean getBooleanParam(java.lang.String param,
                                  boolean defaultValue)
Get the boolean value of a parameter, with a default value if the parameter hasn't been passed to the servlet.


getFirstParamValueString


protected java.lang.String getFirstParamValueString(java.lang.String param)
Returns the first encountered value for a parameter.


getParamValues


protected java.lang.String[] getParamValues(java.lang.String param)
Returns all values for a parameter.


toBoolean


protected boolean toBoolean(java.lang.String string)
A utility method to translate the strings "yes", "true", and "ok" to boolean true, and everything else to false.



Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.